* [PATCH] mellanox: fix the dport endianness in call of __inet6_lookup_established()
@ 2018-08-04 20:41 Al Viro
2018-08-06 0:27 ` David Miller
2018-08-06 17:32 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Al Viro @ 2018-08-04 20:41 UTC (permalink / raw)
To: Boris Pismenny; +Cc: David Miller, netdev
__inet6_lookup_established() expect th->dport passed in host-endian,
not net-endian. The reason is microoptimization in __inet6_lookup(),
but if you use the lower-level helpers, you have to play by their
rules...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_rxtx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_rxtx.c
index 92d37459850e..be137d4a9169 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_rxtx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_rxtx.c
@@ -328,7 +328,7 @@ static int tls_update_resync_sn(struct net_device *netdev,
sk = __inet6_lookup_established(dev_net(netdev), &tcp_hashinfo,
&ipv6h->saddr, th->source,
- &ipv6h->daddr, th->dest,
+ &ipv6h->daddr, ntohs(th->dest),
netdev->ifindex, 0);
#endif
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mellanox: fix the dport endianness in call of __inet6_lookup_established()
2018-08-04 20:41 [PATCH] mellanox: fix the dport endianness in call of __inet6_lookup_established() Al Viro
@ 2018-08-06 0:27 ` David Miller
2018-08-06 9:23 ` Boris Pismenny
2018-08-06 17:32 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2018-08-06 0:27 UTC (permalink / raw)
To: viro; +Cc: borisp, netdev
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: Sat, 4 Aug 2018 21:41:27 +0100
> __inet6_lookup_established() expect th->dport passed in host-endian,
> not net-endian. The reason is microoptimization in __inet6_lookup(),
> but if you use the lower-level helpers, you have to play by their
> rules...
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Mellanox folks, please review.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mellanox: fix the dport endianness in call of __inet6_lookup_established()
2018-08-06 0:27 ` David Miller
@ 2018-08-06 9:23 ` Boris Pismenny
0 siblings, 0 replies; 4+ messages in thread
From: Boris Pismenny @ 2018-08-06 9:23 UTC (permalink / raw)
To: David Miller, viro; +Cc: netdev
On 8/6/2018 3:27 AM, David Miller wrote:
> From: Al Viro <viro@ZenIV.linux.org.uk>
> Date: Sat, 4 Aug 2018 21:41:27 +0100
>
>> __inet6_lookup_established() expect th->dport passed in host-endian,
>> not net-endian. The reason is microoptimization in __inet6_lookup(),
>> but if you use the lower-level helpers, you have to play by their
>> rules...
>>
>> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
>
> Mellanox folks, please review.
>
Looks good to me. Thanks Al.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mellanox: fix the dport endianness in call of __inet6_lookup_established()
2018-08-04 20:41 [PATCH] mellanox: fix the dport endianness in call of __inet6_lookup_established() Al Viro
2018-08-06 0:27 ` David Miller
@ 2018-08-06 17:32 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-08-06 17:32 UTC (permalink / raw)
To: viro; +Cc: borisp, netdev
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: Sat, 4 Aug 2018 21:41:27 +0100
> __inet6_lookup_established() expect th->dport passed in host-endian,
> not net-endian. The reason is microoptimization in __inet6_lookup(),
> but if you use the lower-level helpers, you have to play by their
> rules...
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Applied to net-next, thanks Al.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-06 19:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-04 20:41 [PATCH] mellanox: fix the dport endianness in call of __inet6_lookup_established() Al Viro
2018-08-06 0:27 ` David Miller
2018-08-06 9:23 ` Boris Pismenny
2018-08-06 17:32 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).