naccyde / rpms / iproute

Forked from rpms/iproute 5 months ago
Clone

Blame SOURCES/0009-bridge-fdb-add-use-option-to-set-NTF_USE-flag-in-fdb.patch

049c96
From 56fcd25048b851772694f870b7eeb78ea5e147a7 Mon Sep 17 00:00:00 2001
049c96
From: Phil Sutter <psutter@redhat.com>
049c96
Date: Thu, 18 Feb 2016 12:38:18 +0100
049c96
Subject: [PATCH] bridge fdb: add 'use' option to set NTF_USE flag in fdb add
049c96
 requests
049c96
049c96
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1075692
049c96
Upstream Status: iproute2.git commit cd8df30b7c64d
049c96
049c96
commit cd8df30b7c64da0cf0e3653490a9545f77b59e85
049c96
Author: Roopa Prabhu <roopa@cumulusnetworks.com>
049c96
Date:   Thu Jul 30 14:37:02 2015 -0700
049c96
049c96
    bridge fdb: add 'use' option to set NTF_USE flag in fdb add requests
049c96
049c96
    This is similar to command options corresponding to other NTF_* flags
049c96
    already exposed to the user space (examples self/master).
049c96
049c96
    Also updates bridge man page (The man page patch also includes
049c96
    a fix to the 'self' entry and documents 'master' for fdb entries)
049c96
049c96
    Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
049c96
    Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
049c96
---
049c96
 bridge/fdb.c      |  7 +++++--
049c96
 man/man8/bridge.8 | 15 ++++++++++++---
049c96
 2 files changed, 17 insertions(+), 5 deletions(-)
049c96
049c96
diff --git a/bridge/fdb.c b/bridge/fdb.c
049c96
index 615541e..513b3f9 100644
049c96
--- a/bridge/fdb.c
049c96
+++ b/bridge/fdb.c
049c96
@@ -30,8 +30,9 @@ int filter_index;
049c96
 
049c96
 static void usage(void)
049c96
 {
049c96
-	fprintf(stderr, "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV {self|master} [ temp ]\n"
049c96
-		        "              [router] [ dst IPADDR] [ vlan VID ]\n"
049c96
+	fprintf(stderr, "Usage: bridge fdb { add | append | del | replace ADDR dev DEV\n"
049c96
+			"              [ self ] [ master ] [ use ] [ router ]\n"
049c96
+			"              [ local | temp ] [ dst IPADDR ] [ vlan VID ]\n"
049c96
 		        "              [ port PORT] [ vni VNI ] [via DEV]\n");
049c96
 	fprintf(stderr, "       bridge fdb {show} [ dev DEV ]\n");
049c96
 	exit(-1);
049c96
@@ -269,6 +270,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
049c96
 				duparg2("vlan", *argv);
049c96
 			NEXT_ARG();
049c96
 			vid = atoi(*argv);
049c96
+		} else if (matches(*argv, "use") == 0) {
049c96
+			req.ndm.ndm_flags |= NTF_USE;
049c96
 		} else {
049c96
 			if (strcmp(*argv, "to") == 0) {
049c96
 				NEXT_ARG();
049c96
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
049c96
index 7f67867..68a86e5 100644
049c96
--- a/man/man8/bridge.8
049c96
+++ b/man/man8/bridge.8
049c96
@@ -49,8 +49,8 @@ bridge \- show / manipulate bridge addresses and devices
049c96
 .I LLADDR
049c96
 .B  dev
049c96
 .IR DEV " { "
049c96
-.BR local " | " temp " } { "
049c96
-.BR self " } { " router " } [ "
049c96
+.BR local " | " temp " } [ "
049c96
+.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
049c96
 .B  dst
049c96
 .IR IPADDR " ] [ "
049c96
 .B vni
049c96
@@ -293,7 +293,11 @@ the Ethernet MAC address.
049c96
 the interface to which this address is associated.
049c96
 
049c96
 .B self
049c96
-- the address is associated with a software fdb (default)
049c96
+- the address is associated with the port drivers fdb. Usually hardware.
049c96
+.sp
049c96
+
049c96
+.B master
049c96
+- the address is associated with master devices fdb. Usually software (default).
049c96
 .sp
049c96
 
049c96
 .B router
049c96
@@ -302,6 +306,11 @@ Valid if the referenced device is a VXLAN type device and has
049c96
 route shortcircuit enabled.
049c96
 .sp
049c96
 
049c96
+.B use
049c96
+- the address is in use. User space can use this option to
049c96
+indicate to the kernel that the fdb entry is in use.
049c96
+.sp
049c96
+
049c96
 .in -8
049c96
 The next command line parameters apply only
049c96
 when the specified device
049c96
-- 
049c96
1.8.3.1
049c96