• Taehee Yoo's avatar
    vxlan: fix unexpected failure of vxlan_changelink() · c6761cf5
    Taehee Yoo authored
    After commit 0ce1822c ("vxlan: add adjacent link to limit depth
    level"), vxlan_changelink() could fail because of
    netdev_adjacent_change_prepare().
    netdev_adjacent_change_prepare() returns -EEXIST when old lower device
    and new lower device are same.
    (old lower device is "dst->remote_dev" and new lower device is "lowerdev")
    So, before calling it, lowerdev should be NULL if these devices are same.
    
    Test command1:
        ip link add dummy0 type dummy
        ip link add vxlan0 type vxlan dev dummy0 dstport 4789 vni 1
        ip link set vxlan0 type vxlan ttl 5
        RTNETLINK answers: File exists
    Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
    Fixes: 0ce1822c ("vxlan: add adjacent link to limit depth level")
    Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c6761cf5
vxlan.c 113 KB