1 From db5a55536b23676675149df8c521d7cb90d9ea36 Mon Sep 17 00:00:00 2001
2 From: Eric Dumazet <eric.dumazet@gmail.com>
3 Date: Fri, 20 May 2011 14:59:23 -0400
4 Subject: macvlan: fix panic if lowerdev in a bond
7 From: Eric Dumazet <eric.dumazet@gmail.com>
9 [ Upstream commit d93515611bbc70c2fe4db232e5feb448ed8e4cc9 ]
11 commit a35e2c1b6d905 (macvlan: use rx_handler_data pointer to store
12 macvlan_port pointer V2) added a bug in macvlan_port_create()
14 Steps to reproduce the bug:
16 # ifenslave bond0 eth0 eth1
18 # ip link add link eth0 up name eth0#1 type macvlan
21 # ip link add link eth0 up name eth0#1 type macvlan
24 Fix: Dont set IFF_MACVLAN_PORT in error case.
26 Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
27 Signed-off-by: David S. Miller <davem@davemloft.net>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
30 drivers/net/macvlan.c | 4 ++--
31 1 file changed, 2 insertions(+), 2 deletions(-)
33 --- a/drivers/net/macvlan.c
34 +++ b/drivers/net/macvlan.c
35 @@ -586,8 +586,8 @@ static int macvlan_port_create(struct ne
36 err = netdev_rx_handler_register(dev, macvlan_handle_frame, port);
40 - dev->priv_flags |= IFF_MACVLAN_PORT;
42 + dev->priv_flags |= IFF_MACVLAN_PORT;