Commit:     2b44368307cd06c5614d7b53801f516c0654020b
Parent:     0947c9fe56d9cf7ad0bc3a03ccd30446cde698e4
Author:     Thomas Graf <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 26 17:37:59 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:28:13 2007 -0700

    [NET] fib_rules: Mark rules detached from the device
    Rules which match against device names in their selector can
    remain while the device itself disappears, in fact the device
    doesn't have to present when the rule is added in the first
    place. The device name is resolved by trying when the rule is
    added and later by listening to NETDEV_REGISTER/UNREGISTER
    This patch adds the flag FIB_RULE_DEV_DETACHED which is set
    towards userspace when a rule contains a device match which
    is unresolved at the moment. This eases spotting the reason
    why certain rules seem not to function properly.
    Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
 include/linux/fib_rules.h |    1 +
 net/core/fib_rules.c      |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
index ec9c7b1..c151273 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
 struct fib_rule_hdr
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 0d8bb2e..7ac602c 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);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to