netdev-tc-offloads: Parse ip related fields only if eth type is ip
There is no need to parse ip related fields if eth type is not ip.
@@ -307,7 +307,8 @@ parse_tc_flower_to_match(struct tc_flower *flower,
match_set_dl_type(match, key->eth_type);
}
- if (key->ip_proto && is_ip_any(&match->flow)) {
+ if (is_ip_any(&match->flow)) {
+ if (key->ip_proto) {
match_set_nw_proto(match, key->ip_proto);
}
@@ -319,7 +320,6 @@ parse_tc_flower_to_match(struct tc_flower *flower,
match_set_ipv6_dst_masked(match,
&key->ipv6.ipv6_dst, &mask->ipv6.ipv6_dst);
- if (is_ip_any(&match->flow)) {
if (key->ip_proto == IPPROTO_TCP) {
match_set_tp_dst_masked(match, key->tcp_dst, mask->tcp_dst);
match_set_tp_src_masked(match, key->tcp_src, mask->tcp_src);
