mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
rxrpc: Enable IPv6 checksums on transport socket
commit39cb9faa5d
upstream. AF_RXRPC doesn't currently enable IPv6 UDP Tx checksums on the transport socket it opens and the checksums in the packets it generates end up 0. It probably should also enable IPv6 UDP Rx checksums and IPv4 UDP checksums. The latter only seem to be applied if the socket family is AF_INET and don't seem to apply if it's AF_INET6. IPv4 packets from an IPv6 socket seem to have checksums anyway. What seems to have happened is that the inet_inv_convert_csum() call didn't get converted to the appropriate udp_port_cfg parameters - and udp_sock_create() disables checksums unless explicitly told not too. Fix this by enabling the three udp_port_cfg checksum options. Fixes:1a9b86c9fd
("rxrpc: use udp tunnel APIs instead of open code in rxrpc_open_socket") Reported-by: Marc Dionne <marc.dionne@auristor.com> Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Xin Long <lucien.xin@gmail.com> Reviewed-by: Marc Dionne <marc.dionne@auristor.com> cc: Vadim Fedorenko <vfedorenko@novek.ru> cc: David S. Miller <davem@davemloft.net> cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d3a7333a8f
commit
d783651fc9
1 changed files with 3 additions and 0 deletions
|
@ -117,6 +117,7 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
|
|||
local, srx->transport_type, srx->transport.family);
|
||||
|
||||
udp_conf.family = srx->transport.family;
|
||||
udp_conf.use_udp_checksums = true;
|
||||
if (udp_conf.family == AF_INET) {
|
||||
udp_conf.local_ip = srx->transport.sin.sin_addr;
|
||||
udp_conf.local_udp_port = srx->transport.sin.sin_port;
|
||||
|
@ -124,6 +125,8 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
|
|||
} else {
|
||||
udp_conf.local_ip6 = srx->transport.sin6.sin6_addr;
|
||||
udp_conf.local_udp_port = srx->transport.sin6.sin6_port;
|
||||
udp_conf.use_udp6_tx_checksums = true;
|
||||
udp_conf.use_udp6_rx_checksums = true;
|
||||
#endif
|
||||
}
|
||||
ret = udp_sock_create(net, &udp_conf, &local->socket);
|
||||
|
|
Loading…
Reference in a new issue