|
|
4aca6e |
From 6c0e3f0160da03f50871e2e3692e3168f8c2a62b Mon Sep 17 00:00:00 2001
|
|
|
4aca6e |
From: Phil Sutter <psutter@redhat.com>
|
|
|
4aca6e |
Date: Tue, 28 Feb 2017 16:12:00 +0100
|
|
|
4aca6e |
Subject: [PATCH] bridge: support for static fdb entries
|
|
|
4aca6e |
|
|
|
4aca6e |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1417289
|
|
|
4aca6e |
Upstream Status: iproute2.git commit a1987cd17fcb0
|
|
|
4aca6e |
|
|
|
4aca6e |
commit a1987cd17fcb042bd80f0dc2bf51941769fdb493
|
|
|
4aca6e |
Author: Roopa Prabhu <roopa@cumulusnetworks.com>
|
|
|
4aca6e |
Date: Wed Jan 27 09:09:37 2016 -0800
|
|
|
4aca6e |
|
|
|
4aca6e |
bridge: support for static fdb entries
|
|
|
4aca6e |
|
|
|
4aca6e |
There is no intuitive option to add static fdb entries today.
|
|
|
4aca6e |
'temp' seems to have a side effect of adding
|
|
|
4aca6e |
'static' fdb entries. But the name and intent
|
|
|
4aca6e |
of 'temp' does not say anything about it being static.
|
|
|
4aca6e |
|
|
|
4aca6e |
example:
|
|
|
4aca6e |
bridge fdb add operates as follows:
|
|
|
4aca6e |
|
|
|
4aca6e |
$bridge fdb add 00:01:02:03:04:05 dev eth0 master
|
|
|
4aca6e |
$bridge fdb add 00:01:02:03:04:06 dev eth0 master temp
|
|
|
4aca6e |
$bridge fdb add 00:01:02:03:04:07 dev eth0 master local
|
|
|
4aca6e |
|
|
|
4aca6e |
$bridge fdb show
|
|
|
4aca6e |
00:01:02:03:04:05 dev eth0 permanent
|
|
|
4aca6e |
00:01:02:03:04:06 dev eth0 static
|
|
|
4aca6e |
00:01:02:03:04:07 dev eth0 permanent
|
|
|
4aca6e |
00:01:02:03:04:08 dev eth0 <<== dynamic, ageable learned mac
|
|
|
4aca6e |
|
|
|
4aca6e |
This patch adds a new bridge fdb type 'static' which
|
|
|
4aca6e |
makes sure NUD_NOARP and NUD_REACHABLE is set for static
|
|
|
4aca6e |
entries. This effectively is nothing but what 'temp'
|
|
|
4aca6e |
does today. But the name 'temp' is misleading.
|
|
|
4aca6e |
|
|
|
4aca6e |
After the patch:
|
|
|
4aca6e |
$bridge fdb add 00:01:02:03:04:06 dev eth0 master static
|
|
|
4aca6e |
|
|
|
4aca6e |
$bridge fdb show
|
|
|
4aca6e |
00:01:02:03:04:06 dev eth0 static
|
|
|
4aca6e |
|
|
|
4aca6e |
'temp' could ideally be a dynamic mac that can age (ie just
|
|
|
4aca6e |
NUD_REACHABLE). But, 'temp' sets 'NUD_NOARP' and 'NUD_REACHABLE'.
|
|
|
4aca6e |
Too late to change 'temp' now. But, we are thinking of introduing a
|
|
|
4aca6e |
'dynamic' keyword after this patch that only sets NUD_REACHABLE.
|
|
|
4aca6e |
|
|
|
4aca6e |
Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
|
|
|
4aca6e |
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
|
|
|
4aca6e |
---
|
|
|
4aca6e |
bridge/fdb.c | 5 +++--
|
|
|
4aca6e |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
4aca6e |
|
|
|
4aca6e |
diff --git a/bridge/fdb.c b/bridge/fdb.c
|
|
|
4aca6e |
index 8767c96..cb07345 100644
|
|
|
4aca6e |
--- a/bridge/fdb.c
|
|
|
4aca6e |
+++ b/bridge/fdb.c
|
|
|
4aca6e |
@@ -32,7 +32,7 @@ static void usage(void)
|
|
|
4aca6e |
{
|
|
|
4aca6e |
fprintf(stderr, "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
|
|
|
4aca6e |
" [ self ] [ master ] [ use ] [ router ]\n"
|
|
|
4aca6e |
- " [ local | temp ] [ dst IPADDR ] [ vlan VID ]\n"
|
|
|
4aca6e |
+ " [ local | temp | static ] [ dst IPADDR ] [ vlan VID ]\n"
|
|
|
4aca6e |
" [ port PORT] [ vni VNI ] [ via DEV ]\n");
|
|
|
4aca6e |
fprintf(stderr, " bridge fdb [ show [ br BRDEV ] [ brport DEV ] ]\n");
|
|
|
4aca6e |
exit(-1);
|
|
|
4aca6e |
@@ -300,7 +300,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
|
|
|
4aca6e |
} else if (matches(*argv, "local") == 0||
|
|
|
4aca6e |
matches(*argv, "permanent") == 0) {
|
|
|
4aca6e |
req.ndm.ndm_state |= NUD_PERMANENT;
|
|
|
4aca6e |
- } else if (matches(*argv, "temp") == 0) {
|
|
|
4aca6e |
+ } else if (matches(*argv, "temp") == 0 ||
|
|
|
4aca6e |
+ matches(*argv, "static") == 0) {
|
|
|
4aca6e |
req.ndm.ndm_state |= NUD_REACHABLE;
|
|
|
4aca6e |
} else if (matches(*argv, "vlan") == 0) {
|
|
|
4aca6e |
if (vid >= 0)
|
|
|
4aca6e |
--
|
|
|
4aca6e |
1.8.3.1
|
|
|
4aca6e |
|