Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
[sliver-openvswitch.git] / lib / meta-flow.c
index a168222..d90477a 100644 (file)
@@ -1019,20 +1019,6 @@ mf_is_mask_valid(const struct mf_field *mf, const union mf_value *mask)
     OVS_NOT_REACHED();
 }
 
-static bool
-is_icmpv4(const struct flow *flow)
-{
-    return (flow->dl_type == htons(ETH_TYPE_IP)
-            && flow->nw_proto == IPPROTO_ICMP);
-}
-
-static bool
-is_icmpv6(const struct flow *flow)
-{
-    return (flow->dl_type == htons(ETH_TYPE_IPV6)
-            && flow->nw_proto == IPPROTO_ICMPV6);
-}
-
 /* Returns true if 'flow' meets the prerequisites for 'mf', false otherwise. */
 bool
 mf_are_prereqs_ok(const struct mf_field *mf, const struct flow *flow)
@@ -1312,7 +1298,6 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,
     case MFF_MPLS_BOS:
         value->u8 = mpls_lse_to_bos(flow->mpls_lse[0]);
         break;
-        break;
 
     case MFF_IPV4_SRC:
         value->be32 = flow->nw_src;
@@ -1509,7 +1494,6 @@ mf_set_value(const struct mf_field *mf,
     case MFF_MPLS_BOS:
         match_set_mpls_bos(match, 0, value->u8);
         break;
-        break;
 
     case MFF_IPV4_SRC:
         match_set_nw_src(match, value->be32);
@@ -1723,7 +1707,6 @@ mf_set_flow_value(const struct mf_field *mf,
     case MFF_MPLS_BOS:
         flow_set_mpls_bos(flow, 0, value->u8);
         break;
-        break;
 
     case MFF_IPV4_SRC:
         flow->nw_src = value->be32;
@@ -1769,7 +1752,7 @@ mf_set_flow_value(const struct mf_field *mf,
         break;
 
     case MFF_IP_FRAG:
-        flow->nw_frag &= value->u8;
+        flow->nw_frag = value->u8 & FLOW_NW_FRAG_MASK;
         break;
 
     case MFF_ARP_OP:
@@ -1934,7 +1917,6 @@ mf_set_wild(const struct mf_field *mf, struct match *match)
     case MFF_MPLS_BOS:
         match_set_any_mpls_bos(match, 0);
         break;
-        break;
 
     case MFF_IPV4_SRC:
     case MFF_ARP_SPA: