Skip to content

Commit 8902482

Browse files
viviendavem330
authored andcommitted
net: switchdev: support static FDB addresses
This patch adds a is_static boolean to the switchdev_obj_fdb structure, in order to set the ndm_state to either NUD_NOARP or NUD_REACHABLE. Signed-off-by: Vivien Didelot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1525c38 commit 8902482

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

include/net/switchdev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ struct switchdev_obj {
7272
struct switchdev_obj_fdb { /* PORT_FDB */
7373
u8 addr[ETH_ALEN];
7474
u16 vid;
75+
bool is_static;
7576
} fdb;
7677
} u;
7778
};

net/switchdev/switchdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ static int switchdev_port_fdb_dump_cb(struct net_device *dev,
811811
ndm->ndm_flags = NTF_SELF;
812812
ndm->ndm_type = 0;
813813
ndm->ndm_ifindex = dev->ifindex;
814-
ndm->ndm_state = NUD_REACHABLE;
814+
ndm->ndm_state = obj->u.fdb.is_static ? NUD_NOARP : NUD_REACHABLE;
815815

816816
if (nla_put(dump->skb, NDA_LLADDR, ETH_ALEN, obj->u.fdb.addr))
817817
goto nla_put_failure;

0 commit comments

Comments
 (0)