@@ -268,20 +268,6 @@ static bool is_all_zero(const u8 *fp, size_t size)
268268 return true;
269269}
270270
271- static bool is_all_set (const u8 * fp , size_t size )
272- {
273- int i ;
274-
275- if (!fp )
276- return false;
277-
278- for (i = 0 ; i < size ; i ++ )
279- if (fp [i ] != 0xff )
280- return false;
281-
282- return true;
283- }
284-
285271static int __parse_flow_nlattrs (const struct nlattr * attr ,
286272 const struct nlattr * a [],
287273 u64 * attrsp , bool nz )
@@ -503,9 +489,8 @@ static int metadata_from_nlattrs(struct sw_flow_match *match, u64 *attrs,
503489 return 0 ;
504490}
505491
506- static int ovs_key_from_nlattrs (struct sw_flow_match * match , bool * exact_5tuple ,
507- u64 attrs , const struct nlattr * * a ,
508- bool is_mask )
492+ static int ovs_key_from_nlattrs (struct sw_flow_match * match , u64 attrs ,
493+ const struct nlattr * * a , bool is_mask )
509494{
510495 int err ;
511496 u64 orig_attrs = attrs ;
@@ -562,11 +547,6 @@ static int ovs_key_from_nlattrs(struct sw_flow_match *match, bool *exact_5tuple
562547 SW_FLOW_KEY_PUT (match , eth .type , htons (ETH_P_802_2 ), is_mask );
563548 }
564549
565- if (is_mask && exact_5tuple ) {
566- if (match -> mask -> key .eth .type != htons (0xffff ))
567- * exact_5tuple = false;
568- }
569-
570550 if (attrs & (1 << OVS_KEY_ATTR_IPV4 )) {
571551 const struct ovs_key_ipv4 * ipv4_key ;
572552
@@ -589,13 +569,6 @@ static int ovs_key_from_nlattrs(struct sw_flow_match *match, bool *exact_5tuple
589569 SW_FLOW_KEY_PUT (match , ipv4 .addr .dst ,
590570 ipv4_key -> ipv4_dst , is_mask );
591571 attrs &= ~(1 << OVS_KEY_ATTR_IPV4 );
592-
593- if (is_mask && exact_5tuple && * exact_5tuple ) {
594- if (ipv4_key -> ipv4_proto != 0xff ||
595- ipv4_key -> ipv4_src != htonl (0xffffffff ) ||
596- ipv4_key -> ipv4_dst != htonl (0xffffffff ))
597- * exact_5tuple = false;
598- }
599572 }
600573
601574 if (attrs & (1 << OVS_KEY_ATTR_IPV6 )) {
@@ -627,15 +600,6 @@ static int ovs_key_from_nlattrs(struct sw_flow_match *match, bool *exact_5tuple
627600 is_mask );
628601
629602 attrs &= ~(1 << OVS_KEY_ATTR_IPV6 );
630-
631- if (is_mask && exact_5tuple && * exact_5tuple ) {
632- if (ipv6_key -> ipv6_proto != 0xff ||
633- !is_all_set ((const u8 * )ipv6_key -> ipv6_src ,
634- sizeof (match -> key -> ipv6 .addr .src )) ||
635- !is_all_set ((const u8 * )ipv6_key -> ipv6_dst ,
636- sizeof (match -> key -> ipv6 .addr .dst )))
637- * exact_5tuple = false;
638- }
639603 }
640604
641605 if (attrs & (1 << OVS_KEY_ATTR_ARP )) {
@@ -678,11 +642,6 @@ static int ovs_key_from_nlattrs(struct sw_flow_match *match, bool *exact_5tuple
678642 tcp_key -> tcp_dst , is_mask );
679643 }
680644 attrs &= ~(1 << OVS_KEY_ATTR_TCP );
681-
682- if (is_mask && exact_5tuple && * exact_5tuple &&
683- (tcp_key -> tcp_src != htons (0xffff ) ||
684- tcp_key -> tcp_dst != htons (0xffff )))
685- * exact_5tuple = false;
686645 }
687646
688647 if (attrs & (1 << OVS_KEY_ATTR_TCP_FLAGS )) {
@@ -714,11 +673,6 @@ static int ovs_key_from_nlattrs(struct sw_flow_match *match, bool *exact_5tuple
714673 udp_key -> udp_dst , is_mask );
715674 }
716675 attrs &= ~(1 << OVS_KEY_ATTR_UDP );
717-
718- if (is_mask && exact_5tuple && * exact_5tuple &&
719- (udp_key -> udp_src != htons (0xffff ) ||
720- udp_key -> udp_dst != htons (0xffff )))
721- * exact_5tuple = false;
722676 }
723677
724678 if (attrs & (1 << OVS_KEY_ATTR_SCTP )) {
@@ -804,7 +758,6 @@ static void sw_flow_mask_set(struct sw_flow_mask *mask,
804758 * attribute specifies the mask field of the wildcarded flow.
805759 */
806760int ovs_nla_get_match (struct sw_flow_match * match ,
807- bool * exact_5tuple ,
808761 const struct nlattr * key ,
809762 const struct nlattr * mask )
810763{
@@ -852,13 +805,10 @@ int ovs_nla_get_match(struct sw_flow_match *match,
852805 }
853806 }
854807
855- err = ovs_key_from_nlattrs (match , NULL , key_attrs , a , false);
808+ err = ovs_key_from_nlattrs (match , key_attrs , a , false);
856809 if (err )
857810 return err ;
858811
859- if (exact_5tuple )
860- * exact_5tuple = true;
861-
862812 if (mask ) {
863813 err = parse_flow_mask_nlattrs (mask , a , & mask_attrs );
864814 if (err )
@@ -896,7 +846,7 @@ int ovs_nla_get_match(struct sw_flow_match *match,
896846 }
897847 }
898848
899- err = ovs_key_from_nlattrs (match , exact_5tuple , mask_attrs , a , true);
849+ err = ovs_key_from_nlattrs (match , mask_attrs , a , true);
900850 if (err )
901851 return err ;
902852 } else {
0 commit comments