OSDN Git Service

macvlan: Let passthru macvlan correctly restore lower mac address
authorVlad Yasevich <vyasevich@gmail.com>
Wed, 21 Jun 2017 11:59:19 +0000 (07:59 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Jun 2017 15:17:42 +0000 (11:17 -0400)
commit18c8c54de9a619ba5533419e0170433e20c0ee3e
tree031f1ab28985f41043c067c9481c55cedac30365
parent43c2d578a0ce0d6067a02b46461811aced551425
macvlan: Let passthru macvlan correctly restore lower mac address

Passthru macvlans directly change the mac address of the lower
level device.  That's OK, but after the macvlan is deleted,
the lower device is left with changed address and one needs to
reboot to bring back the origina HW addresses.

This scenario is actually quite common with passthru macvtap devices.

This patch attempts to solve this, by storing the mac address
of the lower device in macvlan_port structure and keeping track of
it through the changes.

After this patch, any changes to the lower device mac address
done trough the macvlan device, will be reverted back.  Any
changs done directly to the lower device mac address will be kept.

Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c