]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iproute2: support NTF_ROUTER flag in VXLAN fdb entries
authorDavid L Stevens <dlstevens@us.ibm.com>
Mon, 6 May 2013 12:11:46 +0000 (05:11 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 6 May 2013 14:54:44 +0000 (07:54 -0700)
This patch allows setting the "NTF_ROUTER" flag in VXLAN forwarding table
entries to enable L3 switching for router destinations while still allowing
L2 redirection appliances for non-router MAC destinations.

Signed-Off-By: David L Stevens <dlstevens@us.ibm.com>
bridge/fdb.c

index bad511d476cddffa64ace766655195595cb32208..6aa5d0a375f54a02a42d676c5f92af2b11124176 100644 (file)
@@ -30,7 +30,7 @@ int filter_index;
 
 static void usage(void)
 {
-       fprintf(stderr, "Usage: bridge fdb { add | del } ADDR dev DEV {self|master} [ temp ]\n"
+       fprintf(stderr, "Usage: bridge fdb { add | del } ADDR dev DEV {self|master} [ temp ] [router]\n"
                        "              [ dst IPADDR] [ vlan VID ]\n"
                        "              [ port PORT] [ vni VNI ] [via DEV]\n");
        fprintf(stderr, "       bridge fdb {show} [ dev DEV ]\n");
@@ -143,6 +143,8 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                fprintf(fp, "self ");
        if (r->ndm_flags & NTF_MASTER)
                fprintf(fp, "master ");
+       if (r->ndm_flags & NTF_ROUTER)
+               fprintf(fp, "router ");
 
        fprintf(fp, "%s\n", state_n2a(r->ndm_state));
        return 0;
@@ -248,6 +250,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
                        req.ndm.ndm_flags |= NTF_SELF;
                } else if (matches(*argv, "master") == 0) {
                        req.ndm.ndm_flags |= NTF_MASTER;
+               } else if (matches(*argv, "router") == 0) {
+                       req.ndm.ndm_flags |= NTF_ROUTER;
                } else if (matches(*argv, "local") == 0||
                           matches(*argv, "permanent") == 0) {
                        req.ndm.ndm_state |= NUD_PERMANENT;