Skip to content

Commit

Permalink
macvlan: Fix passthru macvlan mac address inheritance
Browse files Browse the repository at this point in the history
When a lower device of the passthru macvlan changes it's address,
passthru macvlan is supposed to change it's own address as well.
However, that doesn't happen correctly because the check in
macvlan_addr_busy() will catch the fact that the lower level
(port) mac address is the same as the address we are trying to
assign to the macvlan, and return an error.  As a reasult,
the address of the passthru macvlan device is never changed.

The same thing happens when the user attempts to change the
mac address of the passthru macvlan.

The simple solution appers to be to not check against
the lower device in case of passthru macvlan device, since
the 2 addresses are _supposed_ to be the same.

Signed-off-by: Vladislav Yasevich <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
vyasevich authored and davem330 committed Jun 22, 2017
1 parent e26f43f commit e696cda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ static bool macvlan_addr_busy(const struct macvlan_port *port,
* currently in use by the underlying device or
* another macvlan.
*/
if (ether_addr_equal_64bits(port->dev->dev_addr, addr))
if (!port->passthru &&
ether_addr_equal_64bits(port->dev->dev_addr, addr))
return true;

if (macvlan_hash_lookup(port, addr))
Expand Down

0 comments on commit e696cda

Please sign in to comment.