Skip to content

Commit 566764e

Browse files
committed
rxrpc: Enable IPv6 checksums on transport socket
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-284.30.1.el9_2 commit-author David Howells <[email protected]> commit 39cb9fa 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: 1a9b86c ("rxrpc: use udp tunnel APIs instead of open code in rxrpc_open_socket") Reported-by: Marc Dionne <[email protected]> Signed-off-by: David Howells <[email protected]> Reviewed-by: Xin Long <[email protected]> Reviewed-by: Marc Dionne <[email protected]> cc: Vadim Fedorenko <[email protected]> cc: David S. Miller <[email protected]> cc: [email protected] Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit 39cb9fa) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 7df30ed commit 566764e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/rxrpc/local_object.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,16 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
117117
local, srx->transport_type, srx->transport.family);
118118

119119
udp_conf.family = srx->transport.family;
120+
udp_conf.use_udp_checksums = true;
120121
if (udp_conf.family == AF_INET) {
121122
udp_conf.local_ip = srx->transport.sin.sin_addr;
122123
udp_conf.local_udp_port = srx->transport.sin.sin_port;
123124
#if IS_ENABLED(CONFIG_AF_RXRPC_IPV6)
124125
} else {
125126
udp_conf.local_ip6 = srx->transport.sin6.sin6_addr;
126127
udp_conf.local_udp_port = srx->transport.sin6.sin6_port;
128+
udp_conf.use_udp6_tx_checksums = true;
129+
udp_conf.use_udp6_rx_checksums = true;
127130
#endif
128131
}
129132
ret = udp_sock_create(net, &udp_conf, &local->socket);

0 commit comments

Comments
 (0)