Re: [PATCH net v4 2/2] vxlan: reject VNI add when the default fdb entry is nexthop-backed

From: henry martin

Date: Wed Oct 28 2026 - 07:16:07 EST


Build failure confirmed: vxlan->cfg became an RCU-managed pointer in
current net/main, so .cfg.remote_ip no longer compiles.

v5 uses the function-local cfg pointer (&cfg->remote_ip) instead.
[1/2] unchanged, both dry-run applied on net/main, checkpatch clean.

Regards,
Henry

kernel test robot <lkp@xxxxxxxxx> 于2026年10月28日周三 17:38写道:
>
> Hi Henry,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on net/main]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Henry-Martin/vxlan-reject-VNI-add-when-the-default-fdb-entry-is-nexthop-backed/20261027-184713
> base: net/main
> patch link: https://lore.kernel.org/r/20261027104713.328028-2-bsdhenrymartin%40gmail.com
> patch subject: [PATCH net v4 2/2] vxlan: reject VNI add when the default fdb entry is nexthop-backed
> config: riscv-defconfig (https://download.01.org/0day-ci/archive/20261028/202610281752.nKGCORKp-lkp@xxxxxxxxx/config)
> compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 1da436a23e613c425fc9b868fc8deb979ede47a4)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261028/202610281752.nKGCORKp-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202610281752.nKGCORKp-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> >> drivers/net/vxlan/vxlan_vnifilter.c:846:33: error: member reference type 'struct vxlan_config *' is a pointer; did you mean to use '->'?
> 846 | !vxlan_addr_any(&vxlan->cfg.remote_ip)) {
> | ~~~~~~~~~~^
> | ->
> 1 error generated.
>
>
> vim +846 drivers/net/vxlan/vxlan_vnifilter.c
>
> 819
> 820 static int vxlan_vni_add(struct vxlan_dev *vxlan,
> 821 struct vxlan_vni_group *vg,
> 822 u32 vni, union vxlan_addr *group,
> 823 struct netlink_ext_ack *extack)
> 824 {
> 825 const struct vxlan_config *cfg = rtnl_dereference(vxlan->cfg);
> 826 struct vxlan_vni_node *vninode;
> 827 __be32 v = cpu_to_be32(vni);
> 828 bool changed = false;
> 829 int err = 0;
> 830
> 831 if (vxlan_vnifilter_lookup(vxlan, v))
> 832 return vxlan_vni_update(vxlan, vg, v, group, &changed, extack);
> 833
> 834 err = vxlan_vni_in_use(vxlan->net, vxlan, cfg, v);
> 835 if (err) {
> 836 NL_SET_ERR_MSG(extack, "VNI in use");
> 837 return err;
> 838 }
> 839
> 840 /* A default fdb entry that is backed by a nexthop group can
> 841 * never take a remote; reject before the VNI is installed,
> 842 * otherwise a failure in vxlan_vni_update_group() would leave
> 843 * the VNI half-installed.
> 844 */
> 845 if ((group && !vxlan_addr_any(group)) ||
> > 846 !vxlan_addr_any(&vxlan->cfg.remote_ip)) {
> 847 if (vxlan_fdb_entry_nh_backed(vxlan, all_zeros_mac, v)) {
> 848 NL_SET_ERR_MSG(extack,
> 849 "Cannot add a remote to a nexthop fdb entry");
> 850 return -EOPNOTSUPP;
> 851 }
> 852 }
> 853
> 854 vninode = vxlan_vni_alloc(vxlan, v);
> 855 if (!vninode)
> 856 return -ENOMEM;
> 857
> 858 err = rhashtable_lookup_insert_fast(&vg->vni_hash,
> 859 &vninode->vnode,
> 860 vxlan_vni_rht_params);
> 861 if (err) {
> 862 vxlan_vni_free(vninode);
> 863 return err;
> 864 }
> 865
> 866 __vxlan_vni_add_list(vxlan, vg, vninode);
> 867
> 868 if (vxlan->dev->flags & IFF_UP)
> 869 vxlan_vs_add_del_vninode(vxlan, vninode, false);
> 870
> 871 err = vxlan_vni_update_group(vxlan, vninode, group, true, &changed,
> 872 extack);
> 873
> 874 vxlan_vnifilter_notify(vxlan, vninode, RTM_NEWTUNNEL);
> 875
> 876 return err;
> 877 }
> 878
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki