Thread (17 messages) flat view 17 messages, 3 authors, 2017-03-15

Re: [patch net-next v2 3/9] ipv4: fib_rules: Dump FIB rules when registering FIB notifier

From: David Ahern <hidden>
Date: 2017-03-15 15:22:14

On 3/15/17 5:05 AM, Jiri Pirko wrote:
quoted hunk ↗ jump to hunk
@@ -2510,10 +2511,20 @@ static void mlxsw_sp_router_fib4_abort(struct mlxsw_sp *mlxsw_sp)
 		dev_warn(mlxsw_sp->bus_info->dev, "Failed to set abort trap.\n");
 }
 
+static bool mlxsw_sp_fib4_rule_default(const struct fib_rule *rule)
+{
+	if (!fib4_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL ||
+	    (rule->table != RT_TABLE_LOCAL && rule->table != RT_TABLE_MAIN &&
+	     rule->table != RT_TABLE_DEFAULT))
+		return false;
+	return true;
+}
+
Since a default rule is defined by fib_default_rule_add(), and its
callers, IPv4 and IPv6 should have the above as an exported helper.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help