Skip to content

Commit ccdfd4f

Browse files
pmachatadavem330
authored andcommitted
vxlan: Have vxlan_fdb_replace() save original rdst value
To enable rollbacks after vetoed FDB updates, extend vxlan_fdb_replace() to take an additional argument where it should store the original values of a modified rdst. Update the sole caller. The following patch will make use of the saved value. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a76d1ca commit ccdfd4f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/vxlan.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ EXPORT_SYMBOL_GPL(vxlan_fdb_clear_offload);
625625
/* Replace destination of unicast mac */
626626
static int vxlan_fdb_replace(struct vxlan_fdb *f,
627627
union vxlan_addr *ip, __be16 port, __be32 vni,
628-
__u32 ifindex)
628+
__u32 ifindex, struct vxlan_rdst *oldrd)
629629
{
630630
struct vxlan_rdst *rd;
631631

@@ -637,6 +637,7 @@ static int vxlan_fdb_replace(struct vxlan_fdb *f,
637637
if (!rd)
638638
return 0;
639639

640+
*oldrd = *rd;
640641
dst_cache_reset(&rd->dst_cache);
641642
rd->remote_ip = *ip;
642643
rd->remote_port = port;
@@ -865,6 +866,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
865866
{
866867
__u16 fdb_flags = (ndm_flags & ~NTF_USE);
867868
struct vxlan_rdst *rd = NULL;
869+
struct vxlan_rdst oldrd;
868870
int notify = 0;
869871
int rc;
870872

@@ -890,7 +892,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
890892
if (!(is_multicast_ether_addr(f->eth_addr) ||
891893
is_zero_ether_addr(f->eth_addr))) {
892894
rc = vxlan_fdb_replace(f, ip, port, vni,
893-
ifindex);
895+
ifindex, &oldrd);
894896
notify |= rc;
895897
} else {
896898
return -EOPNOTSUPP;

0 commit comments

Comments
 (0)