From patchwork Mon Mar 25 21:29:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Michelson X-Patchwork-Id: 1064830 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=fail (p=none dis=none) header.from=redhat.com 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 44SnWq5gCwz9sSR for ; Tue, 26 Mar 2019 08:31:35 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 5A444FAA; Mon, 25 Mar 2019 21:30:04 +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 88179F8D for ; Mon, 25 Mar 2019 21:30:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3084D775 for ; Mon, 25 Mar 2019 21:30:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C22E7308338E for ; Mon, 25 Mar 2019 21:29:59 +0000 (UTC) Received: from monae.redhat.com (ovpn-124-114.rdu2.redhat.com [10.10.124.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5AFC55D9CD for ; Mon, 25 Mar 2019 21:29:59 +0000 (UTC) From: Mark Michelson To: dev@openvswitch.org Date: Mon, 25 Mar 2019 17:29:56 -0400 Message-Id: <20190325212956.22093-4-mmichels@redhat.com> In-Reply-To: <20190325212956.22093-1-mmichels@redhat.com> References: <20190325212956.22093-1-mmichels@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 25 Mar 2019 21:29:59 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 3/3] OVN: Make periodic RAs consistent with RA responder. 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 This commit makes periodic RAs from OVN consistent with the RAs sent in response to RSs. Specifically, this ensures that prefix flags are set correctly for each address mode. This commit also gets rid of some redundant definitions for RA prefix option flags from packets.h in favor of the ones in ovn-l7.h. Signed-off-by: Mark Michelson --- lib/packets.h | 3 --- ovn/controller/pinctrl.c | 5 +++-- tests/ovn.at | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/packets.h b/lib/packets.h index e20a70a66..d293b3542 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -978,9 +978,6 @@ struct ovs_nd_prefix_opt { }; BUILD_ASSERT_DECL(ND_PREFIX_OPT_LEN == sizeof(struct ovs_nd_prefix_opt)); -#define ND_PREFIX_ON_LINK 0x80 -#define ND_PREFIX_AUTONOMOUS_ADDRESS 0x40 - /* Neighbor Discovery option: MTU. */ #define ND_MTU_OPT_LEN 8 #define ND_MTU_DEFAULT 0 diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c index 100a20ff2..91952700d 100644 --- a/ovn/controller/pinctrl.c +++ b/ovn/controller/pinctrl.c @@ -1638,7 +1638,7 @@ ipv6_ra_update_config(const struct sbrec_port_binding *pb) config->min_interval = smap_get_int(&pb->options, "ipv6_ra_min_interval", nd_ra_min_interval_default(config->max_interval)); config->mtu = smap_get_int(&pb->options, "ipv6_ra_mtu", ND_MTU_DEFAULT); - config->la_flags = ND_PREFIX_ON_LINK; + config->la_flags = IPV6_ND_RA_OPT_PREFIX_ON_LINK; const char *address_mode = smap_get(&pb->options, "ipv6_ra_address_mode"); if (!address_mode) { @@ -1647,10 +1647,11 @@ ipv6_ra_update_config(const struct sbrec_port_binding *pb) } if (!strcmp(address_mode, "dhcpv6_stateless")) { config->mo_flags = IPV6_ND_RA_FLAG_OTHER_ADDR_CONFIG; + config->la_flags |= IPV6_ND_RA_OPT_PREFIX_AUTONOMOUS; } else if (!strcmp(address_mode, "dhcpv6_stateful")) { config->mo_flags = IPV6_ND_RA_FLAG_MANAGED_ADDR_CONFIG; } else if (!strcmp(address_mode, "slaac")) { - config->la_flags |= ND_PREFIX_AUTONOMOUS_ADDRESS; + config->la_flags |= IPV6_ND_RA_OPT_PREFIX_AUTONOMOUS; } else { VLOG_WARN("Invalid address mode %s", address_mode); goto fail; diff --git a/tests/ovn.at b/tests/ovn.at index 069d3bb30..e7746cb0f 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -10646,7 +10646,7 @@ ra_test 000005dc 80 80 40 aef00000000000000000000000000000 30 fd0f00000000000000 # And the other address mode ovn-nbctl --wait=hv set Logical_Router_Port ro-sw ipv6_ra_configs:address_mode=dhcpv6_stateless -ra_test 000005dc 40 80 40 aef00000000000000000000000000000 30 fd0f0000000000000000000000000000 +ra_test 000005dc 40 c0 40 aef00000000000000000000000000000 30 fd0f0000000000000000000000000000 OVN_CLEANUP([hv1],[hv2]) AT_CLEANUP