From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Richter Subject: [PATCH] iproute vxlan add support for fdb replace command Date: Tue, 30 Jul 2013 08:16:41 +0200 Message-ID: <1375165001-6776-1-git-send-email-tmricht@linux.vnet.ibm.com> Cc: Thomas Richter To: netdev@vger.kernel.org Return-path: Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:46565 "EHLO e06smtp14.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752623Ab3G3GQs (ORCPT ); Tue, 30 Jul 2013 02:16:48 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Jul 2013 07:08:06 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id CF0821B0805F for ; Tue, 30 Jul 2013 07:16:45 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6U6GXlb66846954 for ; Tue, 30 Jul 2013 06:16:34 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r6U6GilL011092 for ; Tue, 30 Jul 2013 00:16:45 -0600 Sender: netdev-owner@vger.kernel.org List-ID: 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 --- bridge/fdb.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index 591fbbe..e2e53f1 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -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 || -- 1.7.1