Skip to content
  • Stefano Brivio's avatar
    udp: Support for error handlers of tunnels with arbitrary destination port · e7cc0824
    Stefano Brivio authored
    
    
    ICMP error handling is currently not possible for UDP tunnels not
    employing a receiving socket with local destination port matching the
    remote one, because we have no way to look them up.
    
    Add an err_handler tunnel encapsulation operation that can be exported by
    tunnels in order to pass the error to the protocol implementing the
    encapsulation. We can't easily use a lookup function as we did for VXLAN
    and GENEVE, as protocol error handlers, which would be in turn called by
    implementations of this new operation, handle the errors themselves,
    together with the tunnel lookup.
    
    Without a socket, we can't be sure which encapsulation error handler is
    the appropriate one: encapsulation handlers (the ones for FoU and GUE
    introduced in the next patch, e.g.) will need to check the new error codes
    returned by protocol handlers to figure out if errors match the given
    encapsulation, and, in turn, report this error back, so that we can try
    all of them in __udp{4,6}_lib_err_encap_no_sk() until we have a match.
    
    v2:
    - Name all arguments in err_handler prototypes (David Miller)
    
    Signed-off-by: default avatarStefano Brivio <sbrivio@redhat.com>
    Reviewed-by: default avatarSabrina Dubroca <sd@queasysnail.net>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e7cc0824