From patchwork Fri Jul 1 10:23:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 643220 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rh79M6yY5z9sxR for ; Sat, 2 Jul 2016 06:21:43 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 3564F10BE7; Fri, 1 Jul 2016 13:21:43 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 9E8AA10BBC for ; Fri, 1 Jul 2016 13:21:42 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 2B76D162D7B for ; Fri, 1 Jul 2016 14:21:42 -0600 (MDT) X-ASG-Debug-ID: 1467404501-0b32373f7e20f00001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar6.cudamail.com with ESMTP id FgLqJ1Sx8L5mEazr (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 01 Jul 2016 14:21:41 -0600 (MDT) X-Barracuda-Envelope-From: guru.ovn@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail-pa0-f68.google.com) (209.85.220.68) by mx1-pf1.cudamail.com with ESMTPS (AES128-SHA encrypted); 1 Jul 2016 20:21:41 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at _netblocks.google.com designates 209.85.220.68 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.220.68 X-Barracuda-RBL-IP: 209.85.220.68 Received: by mail-pa0-f68.google.com with SMTP id us13so10427182pab.1 for ; Fri, 01 Jul 2016 13:21:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=w37jNTywAgycJLJ6HCbruaHzzguVFxqLytindXDBpCQ=; b=bbLy1ziz9ZHQ9036TyPHeM1HmdOXxYfSWlrDa8nJEXp0inKFqtiQWuUUmevncMt/Fp WKTdNJJ2hrnZtqa3fqlH5zRhJ14fksIbf4DLR2B+poMjxDtlQP8D7N0Csg3tAO6EtGT8 MRH2kqcX0XLZfOJLg8PyKa6KudsTKBnWObiI167W2bJRHH1/pKktz9FmrF3AX6/CdN8n HjSxQNzidRN0JhxsXUy2JKyaXVX2Bqhc3bxeg6Y2wEVzQsZFBcrIBjF3TpqRb6Sh3A+B SJOGr+1/F7oPWoZ7kDGVqfy4kRxdg/xnnrh/a0afN5z4rVuL+GpumW1cjgxMS5Qw5tw/ fNmg== X-Gm-Message-State: ALyK8tJ6LYSY9EskZqTFubDXtcmb8VtS12gdQR2fmj31jVFCAAuE1EWSh+XRM7gWvRy1AQ== X-Received: by 10.66.97.104 with SMTP id dz8mr238948pab.22.1467404500323; Fri, 01 Jul 2016 13:21:40 -0700 (PDT) Received: from ubuntu.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id um1sm7585439pac.41.2016.07.01.13.21.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Jul 2016 13:21:39 -0700 (PDT) X-CudaMail-Envelope-Sender: guru.ovn@gmail.com From: Gurucharan Shetty To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-630059687 X-CudaMail-DTE: 070116 X-CudaMail-Originating-IP: 209.85.220.68 Date: Fri, 1 Jul 2016 03:23:38 -0700 X-ASG-Orig-Subj: [##CM-E1-630059687##][PATCH 1/2] ovn-nbctl: Ability to update a route's output port. Message-Id: <1467368619-4916-1-git-send-email-guru@ovn.org> X-Mailer: git-send-email 1.9.1 X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1467404501 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH 1/2] ovn-nbctl: Ability to update a route's output port. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" The command 'lr-route-add' currently cannot update the output port. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- ovn/utilities/ovn-nbctl.c | 4 ++++ tests/ovn-nbctl.at | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 345647a..abeba0b 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -1383,6 +1383,10 @@ nbctl_lr_route_add(struct ctl_context *ctx) nbrec_logical_router_static_route_verify_nexthop(route); nbrec_logical_router_static_route_set_ip_prefix(route, prefix); nbrec_logical_router_static_route_set_nexthop(route, next_hop); + if (ctx->argc == 5) { + nbrec_logical_router_static_route_set_output_port(route, + ctx->argv[4]); + } free(rt_prefix); free(next_hop); free(prefix); diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at index d2d74b6..0c756ed 100644 --- a/tests/ovn-nbctl.at +++ b/tests/ovn-nbctl.at @@ -388,6 +388,14 @@ IPv4 Routes 0.0.0.0/0 192.168.0.1 ]) +AT_CHECK([ovn-nbctl --may-exist lr-route-add lr0 10.0.0.111/24 11.0.0.1 lp1]) +AT_CHECK([ovn-nbctl lr-route-list lr0], [0], [dnl +IPv4 Routes + 10.0.0.0/24 11.0.0.1 lp1 + 10.0.1.0/24 11.0.1.1 lp0 + 0.0.0.0/0 192.168.0.1 +]) + dnl Delete non-existent prefix AT_CHECK([ovn-nbctl lr-route-del lr0 10.0.2.1/24], [1], [], [ovn-nbctl: no matching prefix: 10.0.2.0/24 @@ -398,7 +406,7 @@ AT_CHECK([ovn-nbctl lr-route-del lr0 10.0.1.1/24]) AT_CHECK([ovn-nbctl lr-route-list lr0], [0], [dnl IPv4 Routes - 10.0.0.0/24 11.0.0.1 + 10.0.0.0/24 11.0.0.1 lp1 0.0.0.0/0 192.168.0.1 ])