|
|
4aca6e |
From cd6557d21815618a2ba6d27d8a2015575a854fd1 Mon Sep 17 00:00:00 2001
|
|
|
4aca6e |
From: Phil Sutter <psutter@redhat.com>
|
|
|
4aca6e |
Date: Tue, 28 Feb 2017 16:12:21 +0100
|
|
|
4aca6e |
Subject: [PATCH] bridge: add support for dynamic fdb entries
|
|
|
4aca6e |
|
|
|
4aca6e |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1417289
|
|
|
4aca6e |
Upstream Status: iproute2.git commit c6d0cfb54b8b4
|
|
|
4aca6e |
|
|
|
4aca6e |
commit c6d0cfb54b8b467a57d259f5c9cec91f94f4e59e
|
|
|
4aca6e |
Author: Roopa Prabhu <roopa@cumulusnetworks.com>
|
|
|
4aca6e |
Date: Fri Feb 19 21:34:52 2016 -0800
|
|
|
4aca6e |
|
|
|
4aca6e |
bridge: add support for dynamic fdb entries
|
|
|
4aca6e |
|
|
|
4aca6e |
This patch is a follow up to the recently added
|
|
|
4aca6e |
'static' fdb option.
|
|
|
4aca6e |
|
|
|
4aca6e |
It introduces a new option 'dynamic' which adds
|
|
|
4aca6e |
dynamic fdb entries with NUD_REACHABLE.
|
|
|
4aca6e |
|
|
|
4aca6e |
$bridge fdb add 00:01:02:03:04:06 dev eth0 master dynamic
|
|
|
4aca6e |
|
|
|
4aca6e |
$bridge fdb show
|
|
|
4aca6e |
00:01:02:03:04:06 dev eth0
|
|
|
4aca6e |
|
|
|
4aca6e |
This patch also documents all fdb types. Removes 'temp'
|
|
|
4aca6e |
from usage message since it is now replaced by 'static'.
|
|
|
4aca6e |
'temp' still works and is synonymous with static.
|
|
|
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 |
man/man8/bridge.8 | 14 +++++++++++++-
|
|
|
4aca6e |
2 files changed, 17 insertions(+), 2 deletions(-)
|
|
|
4aca6e |
|
|
|
4aca6e |
diff --git a/bridge/fdb.c b/bridge/fdb.c
|
|
|
4aca6e |
index cb07345..0222fd6 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 | static ] [ dst IPADDR ] [ vlan VID ]\n"
|
|
|
4aca6e |
+ " [ local | static | dynamic ] [ 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 |
@@ -303,6 +303,9 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
|
|
|
4aca6e |
} else if (matches(*argv, "temp") == 0 ||
|
|
|
4aca6e |
matches(*argv, "static") == 0) {
|
|
|
4aca6e |
req.ndm.ndm_state |= NUD_REACHABLE;
|
|
|
4aca6e |
+ } else if (matches(*argv, "dynamic") == 0) {
|
|
|
4aca6e |
+ req.ndm.ndm_state |= NUD_REACHABLE;
|
|
|
4aca6e |
+ req.ndm.ndm_state &= ~NUD_NOARP;
|
|
|
4aca6e |
} else if (matches(*argv, "vlan") == 0) {
|
|
|
4aca6e |
if (vid >= 0)
|
|
|
4aca6e |
duparg2("vlan", *argv);
|
|
|
4aca6e |
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
|
|
|
4aca6e |
index 864f983..0a36e75 100644
|
|
|
4aca6e |
--- a/man/man8/bridge.8
|
|
|
4aca6e |
+++ b/man/man8/bridge.8
|
|
|
4aca6e |
@@ -54,7 +54,7 @@ bridge \- show / manipulate bridge addresses and devices
|
|
|
4aca6e |
.I LLADDR
|
|
|
4aca6e |
.B dev
|
|
|
4aca6e |
.IR DEV " { "
|
|
|
4aca6e |
-.BR local " | " temp " } [ "
|
|
|
4aca6e |
+.BR local " | " static " | " dynamic " } [ "
|
|
|
4aca6e |
.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
|
|
|
4aca6e |
.B dst
|
|
|
4aca6e |
.IR IPADDR " ] [ "
|
|
|
4aca6e |
@@ -338,6 +338,18 @@ the Ethernet MAC address.
|
|
|
4aca6e |
.BI dev " DEV"
|
|
|
4aca6e |
the interface to which this address is associated.
|
|
|
4aca6e |
|
|
|
4aca6e |
+.B local
|
|
|
4aca6e |
+- is a local permanent fdb entry
|
|
|
4aca6e |
+.sp
|
|
|
4aca6e |
+
|
|
|
4aca6e |
+.B static
|
|
|
4aca6e |
+- is a static (no arp) fdb entry
|
|
|
4aca6e |
+.sp
|
|
|
4aca6e |
+
|
|
|
4aca6e |
+.B dynamic
|
|
|
4aca6e |
+- is a dynamic reachable age-able fdb entry
|
|
|
4aca6e |
+.sp
|
|
|
4aca6e |
+
|
|
|
4aca6e |
.B self
|
|
|
4aca6e |
- the address is associated with the port drivers fdb. Usually hardware.
|
|
|
4aca6e |
.sp
|
|
|
4aca6e |
--
|
|
|
4aca6e |
1.8.3.1
|
|
|
4aca6e |
|