[ovs-dev] [ofp-parse-test 1/3] ofp-parse: Properly byteswap in_port.

Ben Pfaff blp at nicira.com
Fri Oct 1 20:49:56 UTC 2010


---
 lib/ofp-parse.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 312eaaa..32e790a 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -465,10 +465,12 @@ parse_ofp_str(char *string, struct ofp_match *match, struct ofpbuf *actions,
                 if (!strcmp(value, "*") || !strcmp(value, "ANY")) {
                     wildcards |= f->wildcard;
                 } else {
+                    uint16_t port_no;
+
                     wildcards &= ~f->wildcard;
                     if (f->wildcard == OFPFW_IN_PORT
-                        && parse_port_name(value, (uint16_t *) data)) {
-                        /* Nothing to do. */
+                        && parse_port_name(value, &port_no)) {
+                        match->in_port = htons(port_no);
                     } else if (f->type == F_U8) {
                         *(uint8_t *) data = str_to_u32(value);
                     } else if (f->type == F_U16) {
-- 
1.7.1





More information about the dev mailing list