]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iproute vxlan add support for fdb replace command
authorThomas Richter <tmricht@linux.vnet.ibm.com>
Tue, 30 Jul 2013 06:16:41 +0000 (08:16 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 4 Aug 2013 18:56:54 +0000 (11:56 -0700)
Add support for the bridge fdb replace command to replace an
existing entry in the vxlan device driver forwarding data base.
The entry is identified with its unicast mac address and its
corresponding remote destination information is updated.

This is useful for virtual machine migration and replaces the
bridge fdb del and bridge fdb add commands.

It follows the same interface as ip neigh replace commands.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
bridge/fdb.c

index 591fbbede010ba8814f7c7ea4183ede845bd121a..e2e53f1feffbceaa2d4914b83418deee9cde0144 100644 (file)
@@ -30,7 +30,7 @@ int filter_index;
 
 static void usage(void)
 {
-       fprintf(stderr, "Usage: bridge fdb { add | append | del } ADDR dev DEV {self|master} [ temp ]\n"
+       fprintf(stderr, "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV {self|master} [ temp ]\n"
                        "              [router] [ dst IPADDR] [ vlan VID ]\n"
                        "              [ port PORT] [ vni VNI ] [via DEV]\n");
        fprintf(stderr, "       bridge fdb {show} [ dev DEV ]\n");
@@ -334,6 +334,8 @@ int do_fdb(int argc, char **argv)
                        return fdb_modify(RTM_NEWNEIGH, NLM_F_CREATE|NLM_F_EXCL, argc-1, argv+1);
                if (matches(*argv, "append") == 0)
                        return fdb_modify(RTM_NEWNEIGH, NLM_F_CREATE|NLM_F_APPEND, argc-1, argv+1);
+               if (matches(*argv, "replace") == 0)
+                       return fdb_modify(RTM_NEWNEIGH, NLM_F_CREATE|NLM_F_REPLACE, argc-1, argv+1);
                if (matches(*argv, "delete") == 0)
                        return fdb_modify(RTM_DELNEIGH, 0, argc-1, argv+1);
                if (matches(*argv, "show") == 0 ||