From bb98f9b951af0f6438d921522a8f54f5ead0d1d0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 1 Oct 2010 13:05:23 -0700 Subject: [PATCH] ofp-parse: Properly byteswap in_port. --- lib/ofp-parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 312eaaaa..32e790a8 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) { -- 2.30.2