[PATCH 3.5 29/62] net: fix 'ip rule' iif/oif device rename

Luis Henriques luis.henriques at canonical.com
Wed Mar 5 14:36:33 UTC 2014


3.5.7.32 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= <maze at google.com>

commit 946c032e5a53992ea45e062ecb08670ba39b99e3 upstream.

ip rules with iif/oif references do not update:
(detach/attach) across interface renames.

Signed-off-by: Maciej Żenczykowski <maze at google.com>
CC: Willem de Bruijn <willemb at google.com>
CC: Eric Dumazet <edumazet at google.com>
CC: Chris Davis <chrismd at google.com>
CC: Carlo Contavalli <ccontavalli at google.com>

Google-Bug-Id: 12936021
Acked-by: Eric Dumazet <edumazet at google.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 net/core/fib_rules.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index d660ad4..cef5e71 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -716,6 +716,13 @@ static int fib_rules_event(struct notifier_block *this, unsigned long event,
 			attach_rules(&ops->rules_list, dev);
 		break;
 
+	case NETDEV_CHANGENAME:
+		list_for_each_entry(ops, &net->rules_ops, list) {
+			detach_rules(&ops->rules_list, dev);
+			attach_rules(&ops->rules_list, dev);
+		}
+		break;
+
 	case NETDEV_UNREGISTER:
 		list_for_each_entry(ops, &net->rules_ops, list)
 			detach_rules(&ops->rules_list, dev);
-- 
1.9.0





More information about the kernel-team mailing list