diff mbox

net: fix 'ip rule' iif/oif device rename

Message ID 1391819028-10722-1-git-send-email-zenczykowski@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Maciej Żenczykowski Feb. 8, 2014, 12:23 a.m. UTC
From: Maciej Żenczykowski <maze@google.com>

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

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

Google-Bug-Id: 12936021
---
 net/core/fib_rules.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Eric Dumazet Feb. 8, 2014, 1:41 a.m. UTC | #1
On Fri, 2014-02-07 at 16:23 -0800, Maciej Żenczykowski wrote:
> From: Maciej Żenczykowski <maze@google.com>
> 
> ip rules with iif/oif references do not update:
> (detach/attach) across interface renames.
> 
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
> CC: Willem de Bruijn <willemb@google.com>
> CC: Eric Dumazet <edumazet@google.com>
> CC: Chris Davis <chrismd@google.com>
> CC: Carlo Contavalli <ccontavalli@google.com>
> 
> Google-Bug-Id: 12936021
> ---
>  net/core/fib_rules.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Acked-by: Eric Dumazet <edumazet@google.com>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Feb. 10, 2014, 3:03 a.m. UTC | #2
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Fri,  7 Feb 2014 16:23:48 -0800

> From: Maciej Żenczykowski <maze@google.com>
> 
> ip rules with iif/oif references do not update:
> (detach/attach) across interface renames.
> 
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
> CC: Willem de Bruijn <willemb@google.com>
> CC: Eric Dumazet <edumazet@google.com>
> CC: Chris Davis <chrismd@google.com>
> CC: Carlo Contavalli <ccontavalli@google.com>
> 
> Google-Bug-Id: 12936021

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index f409e0bd35c0..185c341fafbd 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -745,6 +745,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);