Skip to content

Commit

Permalink
northd: Avoid sending equal port_binding option values.
Browse files Browse the repository at this point in the history
If the Port_Binding.options map already has the correct values set for
the 'ipv6_prefix_delegation' and 'ipv6_prefix' keys, don't update the
map as it will trigger unnecessary jsonrpc messages to be sent on the
wire towards OVN_Southbound.

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
dceara authored and numansiddique committed Jul 29, 2021
1 parent be002aa commit 6756081
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions northd/ovn-northd.c
Expand Up @@ -10199,16 +10199,21 @@ build_ND_RA_flows_for_lrouter_port(
if (!lrport_is_enabled(op->nbrp)) {
prefix_delegation = false;
}
smap_add(&options, "ipv6_prefix_delegation",
prefix_delegation ? "true" : "false");
if (smap_get_bool(&options, "ipv6_prefix_delegation",
false) != prefix_delegation) {
smap_add(&options, "ipv6_prefix_delegation",
prefix_delegation ? "true" : "false");
}

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

smap_destroy(&options);
Expand Down

0 comments on commit 6756081

Please sign in to comment.