From: Ben Pfaff Date: Fri, 13 Mar 2009 23:52:37 +0000 (-0700) Subject: secchan: Fix in-band ODP->OFP port translation. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4720a36c319ba2c9286ad37bc8e770fc20e5a9b;p=openvswitch secchan: Fix in-band ODP->OFP port translation. The in-band and fail-open code uses ODP port numbers internally, but ofproto_add_flow() takes OpenFlow actions and thus needs to receive OpenFlow port numbers. This should fix a problem with in-band control. --- diff --git a/secchan/fail-open.c b/secchan/fail-open.c index 4a024f9a..619b6f46 100644 --- a/secchan/fail-open.c +++ b/secchan/fail-open.c @@ -37,6 +37,7 @@ #include #include "flow.h" #include "mac-learning.h" +#include "odp-util.h" #include "ofproto.h" #include "rconn.h" #include "status.h" @@ -118,7 +119,7 @@ fail_open_handle_flow_miss(struct fail_open *fo, struct ofproto *ofproto, ofproto_add_flow(ofproto, flow, 0, UINT16_MAX, NULL, 0, NULL, -1); } else if (out_port != FLOOD) { /* The output port is known, so add a new flow. */ - action.output.port = htons(out_port); + action.output.port = htons(odp_port_to_ofp_port(out_port)); ofproto_add_flow(ofproto, flow, 0, UINT16_MAX, &action, 1, payload, -1); } else { diff --git a/secchan/in-band.c b/secchan/in-band.c index c3a7c954..b377f2e3 100644 --- a/secchan/in-band.c +++ b/secchan/in-band.c @@ -42,6 +42,7 @@ #include "flow.h" #include "mac-learning.h" #include "netdev.h" +#include "odp-util.h" #include "ofp-print.h" #include "ofproto.h" #include "ofpbuf.h" @@ -191,7 +192,7 @@ in_band_handle_flow_miss(struct in_band *in_band, struct ofproto *ofproto, ofproto_add_flow(ofproto, flow, 0, UINT16_MAX, NULL, 0, NULL, -1); } else if (out_port != FLOOD) { /* The output port is known, so add a new flow. */ - action.output.port = htons(out_port); + action.output.port = htons(odp_port_to_ofp_port(out_port)); ofproto_add_flow(ofproto, flow, 0, UINT16_MAX, &action, 1, payload, -1); } else {