From cae0618cd3612f04d2f88c4724ec7429d124a0be Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 6 Mar 2009 13:30:09 -0800 Subject: [PATCH] flow: Properly translate port numbers in flow_from_match(). The OpenFlow and datapath port numbers for the local port are different. We were translating them in one direction (in flow_to_match()) but not in the other (in flow_from_match()). This fixes a performance problem (we were setting up the wrong flow). --- lib/flow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/flow.c b/lib/flow.c index 5e8250cc..5e3898f2 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -230,7 +230,8 @@ flow_from_match(flow_t *flow, uint32_t *wildcards, } flow->nw_src = match->nw_src; flow->nw_dst = match->nw_dst; - flow->in_port = ntohs(match->in_port); + flow->in_port = (match->in_port == htons(OFPP_LOCAL) ? ODPP_LOCAL + : ntohs(match->in_port)); flow->dl_vlan = match->dl_vlan; flow->dl_type = match->dl_type; flow->tp_src = match->tp_src; -- 2.30.2