net: Convert protocol error handlers from void to int
authorStefano Brivio <sbrivio@redhat.com>
Thu, 8 Nov 2018 11:19:21 +0000 (12:19 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Nov 2018 01:13:08 +0000 (17:13 -0800)
commit32bbd8793f24b0d5beb1cdb33c45c75ad1140e4b
tree69b7c7f0348e063bd81215058130c1b1800410db
parentce7336610ca950cda131293def57a0178d860121
net: Convert protocol error handlers from void to int

We'll need this to handle ICMP errors for tunnels without a sending socket
(i.e. FoU and GUE). There, we might have to look up different types of IP
tunnels, registered as network protocols, before we get a match, so we
want this for the error handlers of IPPROTO_IPIP and IPPROTO_IPV6 in both
inet_protos and inet6_protos. These error codes will be used in the next
patch.

For consistency, return sensible error codes in protocol error handlers
whenever handlers can't handle errors because, even if valid, they don't
match a protocol or any of its states.

This has no effect on existing error handling paths.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
27 files changed:
include/net/icmp.h
include/net/protocol.h
include/net/sctp/sctp.h
include/net/tcp.h
include/net/udp.h
net/dccp/ipv4.c
net/dccp/ipv6.c
net/ipv4/gre_demux.c
net/ipv4/icmp.c
net/ipv4/ip_gre.c
net/ipv4/ipip.c
net/ipv4/tcp_ipv4.c
net/ipv4/tunnel4.c
net/ipv4/udp.c
net/ipv4/udp_impl.h
net/ipv4/udplite.c
net/ipv4/xfrm4_protocol.c
net/ipv6/icmp.c
net/ipv6/ip6_gre.c
net/ipv6/tcp_ipv6.c
net/ipv6/tunnel6.c
net/ipv6/udp.c
net/ipv6/udp_impl.h
net/ipv6/udplite.c
net/ipv6/xfrm6_protocol.c
net/sctp/input.c
net/sctp/ipv6.c