summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/fib_rules.h1
-rw-r--r--net/core/fib_rules.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
index ec9c7b1d3e9..c151273293e 100644
--- a/include/linux/fib_rules.h
+++ b/include/linux/fib_rules.h
@@ -8,6 +8,7 @@
#define FIB_RULE_PERMANENT 1
#define FIB_RULE_INVERT 2
#define FIB_RULE_UNRESOLVED 4
+#define FIB_RULE_DEV_DETACHED 8
struct fib_rule_hdr
{
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 0d8bb2efb0c..7ac602cc8c8 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -450,9 +450,13 @@ static int fib_nl_fill_rule(struct sk_buff *skb, struct fib_rule *rule,
if (rule->action == FR_ACT_GOTO && rule->ctarget == NULL)
frh->flags |= FIB_RULE_UNRESOLVED;
- if (rule->ifname[0])
+ if (rule->ifname[0]) {
NLA_PUT_STRING(skb, FRA_IFNAME, rule->ifname);
+ if (rule->ifindex == -1)
+ frh->flags |= FIB_RULE_DEV_DETACHED;
+ }
+
if (rule->pref)
NLA_PUT_U32(skb, FRA_PRIORITY, rule->pref);