[ovs-dev] [PATCH 1/2] ovn-northd: Only peer router ports to other router ports.
Ben Pfaff
blp at ovn.org
Tue Jul 19 15:42:26 UTC 2016
A router port's "peer", if set, must point to another router port, but the
code as written also accepted switch ports. This caused problems when
switch ports were actually specified.
Reported-by: Gurucharan Shetty <guru at ovn.org>
Reported-at: http://openvswitch.org/pipermail/dev/2016-July/075524.html
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
ovn/northd/ovn-northd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 7ce509d..1b55c15 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -715,7 +715,10 @@ join_logical_ports(struct northd_context *ctx,
sizeof *op->od->router_ports * (op->od->n_router_ports + 1));
op->od->router_ports[op->od->n_router_ports++] = op;
} else if (op->nbr && op->nbr->peer) {
- op->peer = ovn_port_find(ports, op->nbr->peer);
+ struct ovn_port *peer = ovn_port_find(ports, op->nbr->peer);
+ if (peer && peer->nbr) {
+ op->peer = peer;
+ }
}
}
}
--
2.1.3
More information about the dev
mailing list