Skip to content

Commit

Permalink
macvlan: fix panic if lowerdev in a bond
Browse files Browse the repository at this point in the history
commit a35e2c1 (macvlan: use rx_handler_data pointer to store
macvlan_port pointer V2) added a bug in macvlan_port_create()

Steps to reproduce the bug:

# ifenslave bond0 eth0 eth1

# ip link add link eth0 up name eth0#1 type macvlan
->error EBUSY

# ip link add link eth0 up name eth0#1 type macvlan
->panic


Fix: Dont set IFF_MACVLAN_PORT in error case.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed May 20, 2011
1 parent 7196cd6 commit d935156
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,8 @@ static int macvlan_port_create(struct net_device *dev)
err = netdev_rx_handler_register(dev, macvlan_handle_frame, port);
if (err)
kfree(port);

dev->priv_flags |= IFF_MACVLAN_PORT;
else
dev->priv_flags |= IFF_MACVLAN_PORT;
return err;
}

Expand Down

0 comments on commit d935156

Please sign in to comment.