unsigned long flags;
unsigned long flags_mask;
__be32 src_vni;
+ u32 nhid;
};
static bool vxlan_fdb_is_default_entry(const struct vxlan_fdb *f,
return is_zero_ether_addr(f->eth_addr) && f->vni == vxlan->cfg.vni;
}
+static bool vxlan_fdb_nhid_matches(const struct vxlan_fdb *f, u32 nhid)
+{
+ struct nexthop *nh = rtnl_dereference(f->nh);
+
+ return nh && nh->id == nhid;
+}
+
static bool vxlan_fdb_flush_matches(const struct vxlan_fdb *f,
const struct vxlan_dev *vxlan,
const struct vxlan_fdb_flush_desc *desc)
if (desc->src_vni && f->vni != desc->src_vni)
return false;
+ if (desc->nhid && !vxlan_fdb_nhid_matches(f, desc->nhid))
+ return false;
+
return true;
}
static const struct nla_policy vxlan_del_bulk_policy[NDA_MAX + 1] = {
[NDA_SRC_VNI] = { .type = NLA_U32 },
+ [NDA_NH_ID] = { .type = NLA_U32 },
[NDA_NDM_STATE_MASK] = { .type = NLA_U16 },
[NDA_NDM_FLAGS_MASK] = { .type = NLA_U8 },
};
if (tb[NDA_SRC_VNI])
desc.src_vni = cpu_to_be32(nla_get_u32(tb[NDA_SRC_VNI]));
+ if (tb[NDA_NH_ID])
+ desc.nhid = nla_get_u32(tb[NDA_NH_ID]);
+
vxlan_flush(vxlan, &desc);
return 0;