meta-flow: Fix "sparse" warning in mf_are_prereqs_ok().
authorBen Pfaff <blp@nicira.com>
Tue, 24 Jul 2012 22:43:27 +0000 (15:43 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 25 Jul 2012 05:19:18 +0000 (22:19 -0700)
This fixes the following warning from "sparse":

meta-flow.c:830:31: warning: incorrect type in return expression (different
base types)
meta-flow.c:830:31:    expected bool
meta-flow.c:830:31:    got restricted __be16

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/meta-flow.c

index c50cfc5359215119ae0210481cf232c4a9b1afd5..3713ca4e845f9146c3293d65c526312a64c407bc 100644 (file)
@@ -827,7 +827,7 @@ mf_are_prereqs_ok(const struct mf_field *mf, const struct flow *flow)
     case MFP_IPV6:
         return flow->dl_type == htons(ETH_TYPE_IPV6);
     case MFP_VLAN_VID:
-        return flow->vlan_tci & htons(VLAN_CFI);
+        return (flow->vlan_tci & htons(VLAN_CFI)) != 0;
     case MFP_IP_ANY:
         return is_ip_any(flow);