From: Ido Schimmel Date: Tue, 15 Apr 2025 12:11:33 +0000 (+0300) Subject: vxlan: Relocate assignment of default remote device X-Git-Tag: v6.16-rc1~132^2~254^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ba480cca25f26bd0f0e328b2d2f8eab6bde7cc0;p=thirdparty%2Flinux.git vxlan: Relocate assignment of default remote device The default FDB entry can be associated with a net device if a physical device (i.e., 'dev PHYS_DEV') was specified during the creation of the VXLAN device. The assignment of the net device pointer to 'dst->remote_dev' logically belongs in the if block that resolves the pointer from the specified ifindex, so move it there. Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Link: https://patch.msgid.link/20250415121143.345227-6-idosch@nvidia.com Reviewed-by: Nikolay Aleksandrov Signed-off-by: Paolo Abeni --- diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index d3dfc4af95560..d45b63180714c 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -3967,6 +3967,8 @@ static int __vxlan_dev_create(struct net *net, struct net_device *dev, err = netdev_upper_dev_link(remote_dev, dev, extack); if (err) goto unregister; + + dst->remote_dev = remote_dev; } err = rtnl_configure_link(dev, NULL, 0, NULL); @@ -3994,8 +3996,7 @@ static int __vxlan_dev_create(struct net *net, struct net_device *dev, } list_add(&vxlan->next, &vn->vxlan_list); - if (remote_dev) - dst->remote_dev = remote_dev; + return 0; unlink: