From patchwork Fri Nov 2 16:23:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 992422 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42mnVC1XK6zB4Wy for ; Sat, 3 Nov 2018 03:25:07 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 93CB2C0A; Fri, 2 Nov 2018 16:23:16 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 1F6EFAAC for ; Fri, 2 Nov 2018 16:23:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D6BC87F9 for ; Fri, 2 Nov 2018 16:23:13 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 593261BF207; Fri, 2 Nov 2018 16:23:11 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 2 Nov 2018 09:23:06 -0700 Message-Id: <20181102162306.4402-1-blp@ovn.org> X-Mailer: git-send-email 2.16.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH] ovn-northd: Always set nat_addresses and options in Port_Binding. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org In some cases the code didn't set these columns. Found by inspection. Signed-off-by: Ben Pfaff Acked-by: Numan Siddique --- ovn/northd/ovn-northd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index e42ceea99264..665b0d820a05 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -2170,6 +2170,8 @@ ovn_port_update_sbrec(struct northd_context *ctx, struct smap ids = SMAP_INITIALIZER(&ids); sbrec_port_binding_set_external_ids(op->sb, &ids); + + sbrec_port_binding_set_nat_addresses(op->sb, NULL, 0); } else { if (strcmp(op->nbsp->type, "router")) { uint32_t queue_id = smap_get_int( @@ -2202,6 +2204,8 @@ ovn_port_update_sbrec(struct northd_context *ctx, &rl, "Unknown port type '%s' set on logical switch '%s'.", op->nbsp->type, op->nbsp->name); } + + sbrec_port_binding_set_nat_addresses(op->sb, NULL, 0); } else { const char *chassis = NULL; if (op->peer && op->peer->od && op->peer->od->nbr) { @@ -2229,6 +2233,8 @@ ovn_port_update_sbrec(struct northd_context *ctx, } sbrec_port_binding_set_options(op->sb, &new); smap_destroy(&new); + } else { + sbrec_port_binding_set_options(op->sb, NULL); } const char *nat_addresses = smap_get(&op->nbsp->options,