Re: [PATCH net v3] vxlan: do not destroy fdb if register_netdevice() is failed
From: David Miller <davem@davemloft.net>
Date: 2019-07-02 02:06:48
From: Taehee Yoo <ap420073@gmail.com> Date: Fri, 28 Jun 2019 14:07:25 +0900
__vxlan_dev_create() destroys FDB using specific pointer which indicates
a fdb when error occurs.
But that pointer should not be used when register_netdevice() fails because
register_netdevice() internally destroys fdb when error occurs.
This patch makes vxlan_fdb_create() to do not link fdb entry to vxlan dev
internally.
Instead, a new function vxlan_fdb_insert() is added to link fdb to vxlan
dev.
vxlan_fdb_insert() is called after calling register_netdevice().
This routine can avoid situation that ->ndo_uninit() destroys fdb entry
in error path of register_netdevice().
Hence, error path of __vxlan_dev_create() routine can have an opportunity
to destroy default fdb entry by hand.
Test command
ip link add bonding_masters type vxlan id 0 group 239.1.1.1 \
dev enp0s9 dstport 4789
Splat looks like:...
Fixes: 0241b836732f ("vxlan: fix default fdb entry netlink notify ordering during netdev create")
Suggested-by: Roopa Prabhu <redacted>
Signed-off-by: Taehee Yoo <ap420073@gmail.com>Applied and queued up for -stable, thank you.