]> git.proxmox.com Git - ovs.git/commitdiff
ofp-util: Simplify ofputil_decode_switch_features().
authorBen Pfaff <blp@nicira.com>
Fri, 9 May 2014 19:36:30 +0000 (12:36 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 14 May 2014 17:31:43 +0000 (10:31 -0700)
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@nicira.com>
lib/ofp-util.c

index 43662c835e35786dc2f32b8adeb56a330e2726bc..7a64070deb0edeb44c8348bfd427c7374791ad62 100644 (file)
@@ -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;