Skip to content

Commit

Permalink
Disable IPv6 prefix reporting if IPv6 PD is disabled
Browse files Browse the repository at this point in the history
Disable IPv6 prefix delegation reporting in Logical_Router_Port table if
IPv6 prefix delegation state machine has been disabled for the related
logical router port

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
LorenzoBianconi authored and ovsrobot committed Apr 22, 2020
1 parent 4666e86 commit a2827e5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
28 changes: 16 additions & 12 deletions northd/ovn-northd.c
Expand Up @@ -2701,6 +2701,10 @@ ovn_update_ipv6_prefix(struct hmap *ports)
continue;
}

if (!smap_get_bool(&op->nbrp->options, "prefix", false)) {
continue;
}

char prefix[IPV6_SCAN_LEN + 6];
unsigned aid;
const char *ipv6_pd_list = smap_get(&op->sb->options,
Expand Down Expand Up @@ -9346,22 +9350,22 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
}

struct smap options;
smap_clone(&options, &op->sb->options);

/* enable IPv6 prefix delegation */
bool prefix_delegation = smap_get_bool(&op->nbrp->options,
"prefix_delegation", false);
if (prefix_delegation) {
smap_clone(&options, &op->sb->options);
smap_add(&options, "ipv6_prefix_delegation", "true");
sbrec_port_binding_set_options(op->sb, &options);
smap_destroy(&options);
}
smap_add(&options, "ipv6_prefix_delegation",
prefix_delegation ? "true" : "false");
sbrec_port_binding_set_options(op->sb, &options);

if (smap_get_bool(&op->nbrp->options, "prefix", false)) {
smap_clone(&options, &op->sb->options);
smap_add(&options, "ipv6_prefix", "true");
sbrec_port_binding_set_options(op->sb, &options);
smap_destroy(&options);
}
bool ipv6_prefix = smap_get_bool(&op->nbrp->options,
"prefix", false);
smap_add(&options, "ipv6_prefix",
ipv6_prefix ? "true" : "false");
sbrec_port_binding_set_options(op->sb, &options);

smap_destroy(&options);

const char *address_mode = smap_get(
&op->nbrp->ipv6_ra_configs, "address_mode");
Expand Down
7 changes: 7 additions & 0 deletions tests/system-ovn.at
Expand Up @@ -3920,6 +3920,13 @@ OVS_WAIT_UNTIL([
test "${total_pkts}" = "1"
])

ovn-nbctl set logical_router_port rp-sw0 options:prefix=false
ovn-nbctl clear logical_router_port rp-sw0 ipv6_prefix
OVS_WAIT_WHILE([test "$(ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-16)" = "[2001:1db8:3333]"])
AT_CHECK([ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-16], [0], [dnl
[]
])

kill $(pidof tcpdump)
kill $(pidof ovn-controller)

Expand Down

0 comments on commit a2827e5

Please sign in to comment.