Skip to content

Commit 61c1e0e

Browse files
mpalczew96anguy11
authored andcommitted
i40e: Fix add TC filter for IPv6
Fix insufficient distinction between IPv4 and IPv6 addresses when creating a filter. IPv4 and IPv6 are kept in the same memory area. If IPv6 is added, then it's caught by IPv4 check, which leads to err -95. Fixes: 2f4b411 ("i40e: Enable cloud filters via tc-flower") Signed-off-by: Grzegorz Szczurek <[email protected]> Signed-off-by: Mateusz Palczewski <[email protected]> Reviewed-by: Jaroslaw Gawin <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent dc88126 commit 61c1e0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7731,7 +7731,8 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
77317731
return -EOPNOTSUPP;
77327732

77337733
/* adding filter using src_port/src_ip is not supported at this stage */
7734-
if (filter->src_port || filter->src_ipv4 ||
7734+
if (filter->src_port ||
7735+
(filter->src_ipv4 && filter->n_proto != ETH_P_IPV6) ||
77357736
!ipv6_addr_any(&filter->ip.v6.src_ip6))
77367737
return -EOPNOTSUPP;
77377738

@@ -7760,7 +7761,7 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
77607761
cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT);
77617762
}
77627763

7763-
} else if (filter->dst_ipv4 ||
7764+
} else if ((filter->dst_ipv4 && filter->n_proto != ETH_P_IPV6) ||
77647765
!ipv6_addr_any(&filter->ip.v6.dst_ip6)) {
77657766
cld_filter.element.flags =
77667767
cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_IP_PORT);

0 commit comments

Comments
 (0)