X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utilities%2Fovs-ofctl.c;h=c0b7628f66956827f73d75cc974c96ed3b09d5b4;hb=ac7f2d4bb4a92a021553714d1a44c1c62c1817db;hp=c2f4feffae43273a6b30af70d5ef68e2578c8fb6;hpb=fa37b408eac875cbc0d7adbbb3f7a004371172da;p=openvswitch diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index c2f4feff..c0b7628f 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -769,6 +769,7 @@ str_to_flow(char *string, struct ofp_match *match, struct ofpbuf *actions, uint16_t *idle_timeout, uint16_t *hard_timeout, uint64_t *cookie) { + struct ofp_match normalized; char *save_ptr = NULL; char *name; uint32_t wildcards; @@ -870,6 +871,18 @@ str_to_flow(char *string, struct ofp_match *match, struct ofpbuf *actions, } } match->wildcards = htonl(wildcards); + + normalized = *match; + normalize_match(&normalized); + if (memcmp(match, &normalized, sizeof normalized)) { + char *old = ofp_match_to_literal_string(match); + char *new = ofp_match_to_literal_string(&normalized); + VLOG_WARN("The specified flow is not in normal form:"); + VLOG_WARN(" as specified: %s", old); + VLOG_WARN("as normalized: %s", new); + free(old); + free(new); + } } static void