This is simpler and shorter than handling each of these by itself.

CC: Niels van Adrichem <n.l.m.vanadric...@tudelft.nl>
Suggested-by: Alex Wang <al...@nicira.com>
Signed-off-by: Ben Pfaff <b...@nicira.com>
---
 ofproto/ofproto-dpif-xlate.c |   17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 48576ad..d3ad62a 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -1246,21 +1246,8 @@ ofp_port_to_odp_port(const struct xbridge *xbridge, 
ofp_port_t ofp_port)
 static bool
 odp_port_is_alive(const struct xlate_ctx *ctx, ofp_port_t ofp_port)
 {
-    struct xport *xport;
-    struct bfd *bfd;
-
-    xport = get_ofp_port(ctx->xbridge, ofp_port);
-    if (!xport || xport->config & OFPUTIL_PC_PORT_DOWN ||
-        xport->state & OFPUTIL_PS_LINK_DOWN) {
-        return false;
-    }
-
-    bfd = xport->bfd;
-    if (bfd && !bfd_forwarding(bfd)) {
-        return false;
-    }
-
-    return true;
+    struct xport *xport = get_ofp_port(ctx->xbridge, ofp_port);
+    return xport && xport->may_enable;
 }
 
 static struct ofputil_bucket *
-- 
1.7.10.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to