Skip to content

Commit

Permalink
northd.c: Simplify a code chunk by reusing existing ovn_port_get_peer.
Browse files Browse the repository at this point in the history
We already have a helper function for the logic, so reuse it.

Signed-off-by: Han Zhou <hzhou@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
  • Loading branch information
hzhou8 committed Mar 24, 2023
1 parent b90ff83 commit b257cb9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions northd/northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -12550,11 +12550,8 @@ build_arp_resolve_flows_for_lrouter_port(
}

for (size_t i = 0; i < op->od->n_router_ports; i++) {
const char *router_port_name = smap_get(
&op->od->router_ports[i]->nbsp->options,
"router-port");
struct ovn_port *router_port = ovn_port_find(ports,
router_port_name);
struct ovn_port *router_port =
ovn_port_get_peer(ports, op->od->router_ports[i]);
if (!router_port || !router_port->nbrp) {
continue;
}
Expand Down

0 comments on commit b257cb9

Please sign in to comment.