| From foo@baz Thu Feb 27 20:11:26 PST 2014 |
| From: Maciej Żenczykowski <maze@google.com> |
| Date: Fri, 7 Feb 2014 16:23:48 -0800 |
| Subject: net: fix 'ip rule' iif/oif device rename |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| From: Maciej Żenczykowski <maze@google.com> |
| |
| [ Upstream commit 946c032e5a53992ea45e062ecb08670ba39b99e3 ] |
| |
| 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 |
| Acked-by: Eric Dumazet <edumazet@google.com> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| --- |
| net/core/fib_rules.c | 7 +++++++ |
| 1 file changed, 7 insertions(+) |
| |
| --- a/net/core/fib_rules.c |
| +++ b/net/core/fib_rules.c |
| @@ -745,6 +745,13 @@ static int fib_rules_event(struct notifi |
| 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); |