rxrpc: Fix DATA Tx to disable nofrag for UDP on AF_INET6 socket
authorDavid Howells <dhowells@redhat.com>
Mon, 13 Apr 2020 12:57:14 +0000 (13:57 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Apr 2020 23:26:47 +0000 (16:26 -0700)
commit0e631eee17dcea576ab922fa70e4fdbd596ee452
tree95eaeadb8b51a9087a5ef567ecc262ebe06edf52
parent68dac3eb50be32957ae6e1e6da9281a3b7c6658b
rxrpc: Fix DATA Tx to disable nofrag for UDP on AF_INET6 socket

Fix the DATA packet transmission to disable nofrag for UDPv4 on an AF_INET6
socket as well as UDPv6 when trying to transmit fragmentably.

Without this, packets filled to the normal size used by the kernel AFS
client of 1412 bytes be rejected by udp_sendmsg() with EMSGSIZE
immediately.  The ->sk_error_report() notification hook is called, but
rxrpc doesn't generate a trace for it.

This is a temporary fix; a more permanent solution needs to involve
changing the size of the packets being filled in accordance with the MTU,
which isn't currently done in AF_RXRPC.  The reason for not doing so was
that, barring the last packet in an rx jumbo packet, jumbos can only be
assembled out of 1412-byte packets - and the plan was to construct jumbos
on the fly at transmission time.

Also, there's no point turning on IPV6_MTU_DISCOVER, since IPv6 has to
engage in this anyway since fragmentation is only done by the sender.  We
can then condense the switch-statement in rxrpc_send_data_packet().

Fixes: 75b54cb57ca3 ("rxrpc: Add IPv6 support")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/local_object.c
net/rxrpc/output.c