From: Ben Pfaff Date: Fri, 6 Mar 2009 21:30:09 +0000 (-0800) Subject: flow: Properly translate port numbers in flow_from_match(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cae0618cd3612f04d2f88c4724ec7429d124a0be;p=openvswitch 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). --- 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;