mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 03:40:04 +00:00
net/mlx5e: Fix loopback self test when GRO is off
[ Upstream commitef7a3518f7
] When GRO is off, the transport header pointer in sk_buff is initialized to network's header. To find the udp header, instead of using udp_hdr() which assumes skb_network_header was set, manually calculate the udp header offset. Fixes:0952da791c
("net/mlx5e: Add support for loopback selftest") Signed-off-by: Inbar Karmy <inbark@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ff01f118d1
commit
5b5be45ed1
1 changed files with 2 additions and 1 deletions
|
@ -216,7 +216,8 @@ mlx5e_test_loopback_validate(struct sk_buff *skb,
|
||||||
if (iph->protocol != IPPROTO_UDP)
|
if (iph->protocol != IPPROTO_UDP)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
udph = udp_hdr(skb);
|
/* Don't assume skb_transport_header() was set */
|
||||||
|
udph = (struct udphdr *)((u8 *)iph + 4 * iph->ihl);
|
||||||
if (udph->dest != htons(9))
|
if (udph->dest != htons(9))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue