[ovs-dev] [of1.5 v2 12/20] ofp-util: Simplify ofputil_decode_switch_features().

Ben Pfaff blp at nicira.com
Sat May 10 02:40:28 UTC 2014


It does not need to check the size, because the decoder in ofp-msgs.c
checks for a valid size.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 lib/ofp-util.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 0267d8f..481410a 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -4022,10 +4022,6 @@ ofputil_decode_switch_features(const struct ofp_header *oh,
     features->capabilities = ntohl(osf->capabilities) &
         ofputil_capabilities_mask(oh->version);
 
-    if (ofpbuf_size(b) % ofputil_get_phy_port_size(oh->version)) {
-        return OFPERR_OFPBRC_BAD_LEN;
-    }
-
     if (raw == OFPRAW_OFPT10_FEATURES_REPLY) {
         if (osf->capabilities & htonl(OFPC10_STP)) {
             features->capabilities |= OFPUTIL_C_STP;
-- 
1.9.1




More information about the dev mailing list