From: Maciej Żenczykowski Date: Sat, 8 Feb 2014 00:23:48 +0000 (-0800) Subject: net: fix 'ip rule' iif/oif device rename X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=14bc205c25fa43583e4ad91f3400ab23db4e3d8a;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git net: fix 'ip rule' iif/oif device rename [ Upstream commit 946c032e5a53992ea45e062ecb08670ba39b99e3 ] ip rules with iif/oif references do not update: (detach/attach) across interface renames. Signed-off-by: Maciej Żenczykowski CC: Willem de Bruijn CC: Eric Dumazet CC: Chris Davis CC: Carlo Contavalli Google-Bug-Id: 12936021 Acked-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 0e9131195eb..55e08e2de3a 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -720,6 +720,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);