• David Howells's avatar
    rxrpc: Fix ICMP/ICMP6 error handling · ac56a0b4
    David Howells authored
    Because rxrpc pretends to be a tunnel on top of a UDP/UDP6 socket, allowing
    it to siphon off UDP packets early in the handling of received UDP packets
    thereby avoiding the packet going through the UDP receive queue, it doesn't
    get ICMP packets through the UDP ->sk_error_report() callback.  In fact, it
    doesn't appear that there's any usable option for getting hold of ICMP
    packets.
    
    Fix this by adding a new UDP encap hook to distribute error messages for
    UDP tunnels.  If the hook is set, then the tunnel driver will be able to
    see ICMP packets.  The hook provides the offset into the packet of the UDP
    header of the original packet that caused the notification.
    
    An alternative would be to call the ->error_handler() hook - but that
    requires that the skbuff be cloned (as ip_icmp_error() or ipv6_cmp_error()
    do, though isn't really necessary or desirable in rxrpc's case is we want
    to parse them there and then, not queue them).
    
    Changes
    =======
    ver #3)
     - Fixed an uninitialised variable.
    
    ver #2)
     - Fixed some missing CONFIG_AF_RXRPC_IPV6 conditionals.
    
    Fixes: 5271953c ("rxrpc: Use the UDP encap_rcv hook")
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    ac56a0b4
peer_event.c 15.1 KB