From 542da2c545d5c309524620a6fe3683cbfb205936 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 28 Feb 2017 16:09:45 +0100 Subject: [PATCH] bridge/fdb: add flag/indication for FDB entry synced from offload device Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1417289 Upstream Status: iproute2.git commit 28467b7f3facd commit 28467b7f3facd6114b2fbe0c9fecf57adbd52e12 Author: Scott Feldman Date: Thu Dec 4 09:57:15 2014 +0100 bridge/fdb: add flag/indication for FDB entry synced from offload device Add NTF_EXT_LEARNED flag to neigh flags to indicate FDB entry learned by device has been learned externally to bridge FDB. For these entries, add "external" annotation in bridge fdb show output: 00:02:00:00:03:00 dev swp2 used 2/2 master br0 external 00:02:00:00:03:00 dev swp2 self permanent In the example above, 00:02:00:00:03:00 is shown twice on dev swp2. The first entry if from the bridge (master) and is marked as "external" by the offload device. The second entry is from the brport offload device (self), and was learned by the device. Signed-off-by: Scott Feldman Signed-off-by: Jiri Pirko Acked-by: Jamal Hadi Salim --- bridge/fdb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bridge/fdb.c b/bridge/fdb.c index 77f0c77..e411932 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -158,6 +158,8 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) fprintf(fp, "master "); if (r->ndm_flags & NTF_ROUTER) fprintf(fp, "router "); + if (r->ndm_flags & NTF_EXT_LEARNED) + fprintf(fp, "external "); fprintf(fp, "%s\n", state_n2a(r->ndm_state)); return 0; -- 1.8.3.1