From d7d3c05135f37d8fdf73f9966d27155cada36e56 Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Mon, 25 Aug 2014 21:38:27 +0200 Subject: [PATCH] team: set IFF_TEAM_PORT priv_flag after rx_handler is registered When one tries to add eth as a port into team and that eth is already in use by other rx_handler device (macvlan, bond, bridge, ...) a bug in team_port_add() causes that IFF_TEAM_PORT flag is set before rx_handler is registered. In between, netdev nofifier is called and team_device_event() sees IFF_TEAM_PORT and thinks that rx_handler_data pointer is set to team_port. But it isn't. Fix this by reordering rx_handler register and IFF_TEAM_PORT priv flag set so it is very similar to how bonding does this. Reported-by: Erik Hugne Fixes: 3d249d4ca7 "net: introduce ethernet teaming device" Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller --- Reading git-format-patch failed