summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Michelson <mmichels@redhat.com>2019-03-25 17:29:56 -0400
committerBen Pfaff <blp@ovn.org>2019-03-25 14:52:58 -0700
commit2924b48d4a60ab5e4769169f7f8931c64f7823a5 (patch)
tree356ce17bfcab6beb5ddc10ce01984963f640d6bf
parent54f2d115a6140c20699e4091e87c0bb39a0a63c1 (diff)
downloadopenvswitch-2924b48d4a60ab5e4769169f7f8931c64f7823a5.tar.gz
OVN: Make periodic RAs consistent with RA responder.
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 <mmichels@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r--lib/packets.h3
-rw-r--r--ovn/controller/pinctrl.c5
-rw-r--r--tests/ovn.at2
3 files changed, 4 insertions, 6 deletions
diff --git a/lib/packets.h b/lib/packets.h
index 34abdc9ea..8ae054a74 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 1cdc47053..8cc6b40fa 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -1637,7 +1637,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) {
@@ -1646,10 +1646,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 328e346d4..4b14720f3 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -10454,7 +10454,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