]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Mon, 19 Mar 2018 17:20:10 +0000 (10:20 -0700)
committerDavid Ahern <dsahern@gmail.com>
Tue, 20 Mar 2018 15:24:51 +0000 (08:24 -0700)
NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
Provide a bridge command option to allow a user to set
NTF_EXT_LEARNED on a bridge fdb entry.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
bridge/fdb.c
man/man8/bridge.8

index 205b4faa99a2ac3f5244038b9e8582af05f147fc..4dbc894ceab9396ac53712dc1d55bdbb2589fd90 100644 (file)
@@ -36,7 +36,7 @@ static void usage(void)
 {
        fprintf(stderr,
                "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
-               "              [ self ] [ master ] [ use ] [ router ]\n"
+               "              [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
                "              [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
                "              [ port PORT] [ vni VNI ] [ via DEV ]\n"
                "       bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
@@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
                        vid = atoi(*argv);
                } else if (matches(*argv, "use") == 0) {
                        req.ndm.ndm_flags |= NTF_USE;
+               } else if (matches(*argv, "extern_learn") == 0) {
+                       req.ndm.ndm_flags |= NTF_EXT_LEARNED;
                } else {
                        if (strcmp(*argv, "to") == 0)
                                NEXT_ARG();
index 05512b029fb9f90200b7bd0361e81bc7ea4a7638..e7f7148315e19ddfb356839524c29976ef661715 100644 (file)
@@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
 .B dev
 .IR DEV " { "
 .BR local " | " static " | " dynamic " } [ "
-.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
+.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
 .B dst
 .IR IPADDR " ] [ "
 .B vni
@@ -414,6 +414,12 @@ route shortcircuit enabled.
 indicate to the kernel that the fdb entry is in use.
 .sp
 
+.B extern_learn
+- this entry was learned externally. This option can be used to
+indicate to the kernel that an entry was hardware or user-space
+controller learnt dynamic entry. Kernel will not age such an entry.
+.sp
+
 .in -8
 The next command line parameters apply only
 when the specified device