From: Natasha Gude Date: Wed, 16 Apr 2008 18:30:55 +0000 (-0700) Subject: Updated version references to OFP_VERSION X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8623e6c16e7af939ed97e84b7e9b338215f04d49;p=openvswitch Updated version references to OFP_VERSION --- diff --git a/datapath/forward.c b/datapath/forward.c index 7e987e33..c1b70ca7 100644 --- a/datapath/forward.c +++ b/datapath/forward.c @@ -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; diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 2a76991d..98ee7692 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -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); diff --git a/switch/datapath.c b/switch/datapath.c index 94100612..6fdd2dd7 100644 --- a/switch/datapath.c +++ b/switch/datapath.c @@ -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;