X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utilities%2Fovs-ofctl.c;h=c0b7628f66956827f73d75cc974c96ed3b09d5b4;hb=c71270b7aefddd967d7dd5446f7701241380b09d;hp=1a0c9363e78d42eecb27619a78c22de88eee05d9;hpb=0caf6bde24f37a616b64075e65ad5eede73398ba;p=openvswitch diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 1a0c9363..c0b7628f 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,7 @@ #include "netlink.h" #include "odp-util.h" #include "ofp-print.h" +#include "ofp-util.h" #include "ofpbuf.h" #include "openflow/nicira-ext.h" #include "openflow/openflow.h" @@ -767,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; @@ -868,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