net: switchdev: support static FDB addresses
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Thu, 6 Aug 2015 05:44:03 +0000 (01:44 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Aug 2015 05:48:09 +0000 (22:48 -0700)
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 <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/switchdev.h
net/switchdev/switchdev.c

index e90e1a0fa5792c233d4d8f3d2d6267358344430a..0e296b82aef312631fa618eb89e441b0dccd0c2c 100644 (file)
@@ -72,6 +72,7 @@ struct switchdev_obj {
                struct switchdev_obj_fdb {              /* PORT_FDB */
                        u8 addr[ETH_ALEN];
                        u16 vid;
+                       bool is_static;
                } fdb;
        } u;
 };
index 9db87a34f8661601dcb64e530f2ca91363a63bc6..e9d1cacc4060250d6cae0565f8f0d0a5906d3ebd 100644 (file)
@@ -811,7 +811,7 @@ static int switchdev_port_fdb_dump_cb(struct net_device *dev,
        ndm->ndm_flags   = NTF_SELF;
        ndm->ndm_type    = 0;
        ndm->ndm_ifindex = dev->ifindex;
-       ndm->ndm_state   = NUD_REACHABLE;
+       ndm->ndm_state   = obj->u.fdb.is_static ? NUD_NOARP : NUD_REACHABLE;
 
        if (nla_put(dump->skb, NDA_LLADDR, ETH_ALEN, obj->u.fdb.addr))
                goto nla_put_failure;