• Jiri Wiesner's avatar
    ipvlan: do not add hardware address of master to its unicast filter list · 63aae7b1
    Jiri Wiesner authored
    There is a problem when ipvlan slaves are created on a master device that
    is a vmxnet3 device (ipvlan in VMware guests). The vmxnet3 driver does not
    support unicast address filtering. When an ipvlan device is brought up in
    ipvlan_open(), the ipvlan driver calls dev_uc_add() to add the hardware
    address of the vmxnet3 master device to the unicast address list of the
    master device, phy_dev->uc. This inevitably leads to the vmxnet3 master
    device being forced into promiscuous mode by __dev_set_rx_mode().
    
    Promiscuous mode is switched on the master despite the fact that there is
    still only one hardware address that the master device should use for
    filtering in order for the ipvlan device to be able to receive packets.
    The comment above struct net_device describes the uc_promisc member as a
    "counter, that indicates, that promiscuous mode has been enabled due to
    the need to listen to additional unicast addresses in a device that does
    not implement ndo_set_rx_mode()". Moreover, the design of ipvlan
    guarantees that only the hardware address of a master device,
    phy_dev->dev_addr, will be used to transmit and receive all packets from
    its ipvlan slaves. Thus, the unicast address list of the master device
    should not be modified by ipvlan_open() and ipvlan_stop() in order to make
    ipvlan a workable option on masters that do not support unicast address
    filtering.
    
    Fixes: 2ad7bf36 ("ipvlan: Initial check-in of the IPVLAN driver")
    Reported-by: default avatarPer Sundstrom <per.sundstrom@redqube.se>
    Signed-off-by: default avatarJiri Wiesner <jwiesner@suse.com>
    Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
    Acked-by: default avatarMahesh Bandewar <maheshb@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    63aae7b1
ipvlan_main.c 26.9 KB