Updated version references to OFP_VERSION
authorNatasha Gude <natasha@nicira.com>
Wed, 16 Apr 2008 18:30:55 +0000 (11:30 -0700)
committerNatasha Gude <natasha@nicira.com>
Wed, 16 Apr 2008 18:30:55 +0000 (11:30 -0700)
datapath/forward.c
lib/ofp-print.c
switch/datapath.c

index 7e987e338cf79c46fe29ee1e3ab0cd05d2e7b297..c1b70ca73e1e10dac86ddbea13b13a88f479e911 100644 (file)
@@ -517,7 +517,7 @@ fwd_control_input(struct sw_chain *chain, const struct sender *sender,
        struct ofp_header *oh;
 
        oh = (struct ofp_header *) msg;
-       if (oh->version != 1 || oh->type >= ARRAY_SIZE(packets)
+       if (oh->version != OFP_VERSION || oh->type >= ARRAY_SIZE(packets)
                || ntohs(oh->length) > length)
                return -EINVAL;
 
index 2a76991d444444ac5377887d8feb0ad03c851a6b..98ee76928a25a302082cd442c8e6709cade07281 100644 (file)
@@ -632,7 +632,7 @@ ofp_to_string(const void *oh_, size_t len, int verbosity)
         ds_put_cstr(&string, "OpenFlow packet too short:\n");
         ds_put_hex_dump(&string, oh, len, 0, true);
         return ds_cstr(&string);
-    } else if (oh->version != 1) {
+    } else if (oh->version != OFP_VERSION) {
         ds_put_format(&string, "Bad OpenFlow version %"PRIu8":\n", oh->version);
         ds_put_hex_dump(&string, oh, len, 0, true);
         return ds_cstr(&string);
index 94100612fc63aa290a88c02501b11e266c0d84fa..6fdd2dd777d7803b49de39c99ac014171f9a443c 100644 (file)
@@ -1199,7 +1199,7 @@ fwd_control_input(struct datapath *dp, const struct sender *sender,
     struct ofp_header *oh;
 
     oh = (struct ofp_header *) msg;
-    if (oh->version != 1 || oh->type >= ARRAY_SIZE(packets)
+    if (oh->version != OFP_VERSION || oh->type >= ARRAY_SIZE(packets)
         || ntohs(oh->length) > length)
         return -EINVAL;