Skip to content

Commit

Permalink
TODO: squash
Browse files Browse the repository at this point in the history
Signed-off-by: Dumitru Ceara <[email protected]>
  • Loading branch information
dceara committed Dec 12, 2024
1 parent ade3c77 commit 18464c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/ovn-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,17 @@ lrp_network_to_string(const struct lport_addresses *addresses, struct ds *s,
{
ds_put_cstr(s, addresses->ea_s);
for (size_t i = 0; i < addresses->n_ipv4_addrs; i++) {
struct ipv4_netaddr addr = addresses->ipv4_addrs[i];
ds_put_format(s, " %s/%d", addr.addr_s, addr.plen);
struct ipv4_netaddr *addr = &addresses->ipv4_addrs[i];
ds_put_format(s, " %s/%d", addr->addr_s, addr->plen);
}
for (size_t i = 0; i < addresses->n_ipv6_addrs; i++) {
/* The generated v6 address is always at the end
* (see extract_lrp_networks). */
if (!include_generated_v6 && i == addresses->n_ipv6_addrs -1) {
break;
}
struct ipv6_netaddr addr = addresses->ipv6_addrs[i];
ds_put_format(s, " %s/%d", addr.addr_s, addr.plen);
struct ipv6_netaddr *addr = &addresses->ipv6_addrs[i];
ds_put_format(s, " %s/%d", addr->addr_s, addr->plen);
}
}

Expand Down
11 changes: 4 additions & 7 deletions northd/northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3142,14 +3142,11 @@ ovn_port_update_sbrec(struct ovsdb_idl_txn *ovnsb_txn,
sbrec_port_binding_set_parent_port(op->sb, NULL);
sbrec_port_binding_set_tag(op->sb, NULL, 0);

const struct lport_addresses *networks;
if (op->primary_port) {
networks = &op->primary_port->lrp_networks;
} else {
networks = &op->lrp_networks;
}
struct ds s = DS_EMPTY_INITIALIZER;
lrp_network_to_string(networks, &s, false);
lrp_network_to_string(op->primary_port
? &op->primary_port->lrp_networks
: &op->lrp_networks,
&s, false);
const char *addresses = ds_cstr(&s);
sbrec_port_binding_set_mac(op->sb, &addresses, 1);
ds_destroy(&s);
Expand Down

0 comments on commit 18464c7

Please sign in to comment.