From patchwork Thu Mar 9 02:53:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoshuai Li X-Patchwork-Id: 736815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.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 3vdw2k0rC0z9sNK for ; Thu, 9 Mar 2017 13:54:05 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 66A95B8F; Thu, 9 Mar 2017 02:54:02 +0000 (UTC) X-Original-To: ovs-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 4BC5F6C for ; Thu, 9 Mar 2017 02:54:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtp2203-239.mail.aliyun.com (smtp2203-239.mail.aliyun.com [121.197.203.239]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 015C112A for ; Thu, 9 Mar 2017 02:53:59 +0000 (UTC) X-Alimail-AntiSpam: AC=CONTINUE; BC=0.0748164|-1; FP=0|0|0|0|0|-1|-1|-1; HT=e02c03309; MF=ligs@dtdream.com; NM=1; PH=DS; RN=3; RT=3; SR=0; TI=SMTPD_---.7mZW3Bs_1489028025; Received: from localhost.localdomain(mailfrom:ligs@dtdream.com ip:111.198.29.132) by smtp.aliyun-inc.com(10.147.41.231); Thu, 09 Mar 2017 10:53:46 +0800 From: Guoshuai Li To: ovs-dev@openvswitch.org Date: Thu, 9 Mar 2017 10:53:37 +0800 Message-Id: <20170309025337.5180-1-ligs@dtdream.com> X-Mailer: git-send-email 2.10.1.windows.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v5] ovn: Modify the DHCPv4 router option to optional 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 Co-authored-by: Dong Jun Signed-off-by: Dong Jun Signed-off-by: Guoshuai Li Acked-by: Numan Siddique --- NEWS | 2 ++ ovn/northd/ovn-northd.c | 10 +++------- ovn/ovn-nb.xml | 16 ++++++++-------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/NEWS b/NEWS index ce9fe88..853b5ef 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ Post-v2.7.0 `egress_pkt_mark` OVSDB option. - EMC insertion probability is reduced to 1% and is configurable via the new 'other_config:emc-insert-inv-prob' option. + - OVN: + * Modify the DHCPv4 router option to optional in northbound databases. v2.7.0 - xx xxx xxxx --------------------- diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index cc9b934..8c8f16b 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -2279,11 +2279,9 @@ build_dhcpv4_action(struct ovn_port *op, ovs_be32 offer_ip, &op->nbsp->dhcpv4_options->options, "server_mac"); const char *lease_time = smap_get( &op->nbsp->dhcpv4_options->options, "lease_time"); - const char *router = smap_get( - &op->nbsp->dhcpv4_options->options, "router"); - if (!(server_ip && server_mac && lease_time && router)) { - /* "server_id", "server_mac", "lease_time" and "router" should be + if (!(server_ip && server_mac && lease_time)) { + /* "server_id", "server_mac" and "lease_time" should be * present in the dhcp_options. */ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); VLOG_WARN_RL(&rl, "Required DHCPv4 options not defined for lport - %s", @@ -2826,9 +2824,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows) &od->nbs->ports[i]->dhcpv4_options->options, "server_mac"); const char *lease_time = smap_get( &od->nbs->ports[i]->dhcpv4_options->options, "lease_time"); - const char *router = smap_get( - &od->nbs->ports[i]->dhcpv4_options->options, "router"); - if (server_id && server_mac && lease_time && router) { + if (server_id && server_mac && lease_time) { struct ds match = DS_EMPTY_INITIALIZER; const char *actions = has_stateful ? "ct_commit; next;" : "next;"; diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml index 88a6082..46a25f6 100644 --- a/ovn/ovn-nb.xml +++ b/ovn/ovn-nb.xml @@ -1393,14 +1393,6 @@ The Ethernet address for the DHCP server to use. - -

- The IP address of a gateway for the client to use. This should be - in the subnet of the offered IP. The DHCPv4 option code for this - option is 3. -

-
-

@@ -1422,6 +1414,14 @@ DHCPv4 options and their codes.

+ +

+ The IP address of a gateway for the client to use. This should be + in the subnet of the offered IP. The DHCPv4 option code for this + option is 3. +

+
+

The DHCPv4 option code for this option is 1.