]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
socket: Implement SO_RERROR
authorRoy Marples <roy@marples.name>
Wed, 28 Jul 2021 15:46:59 +0000 (08:46 -0700)
committerKevin Bowling <kbowling@FreeBSD.org>
Wed, 11 Aug 2021 01:59:36 +0000 (18:59 -0700)
commit664077e69e8f300cd0218e3c700ee235df12fcff
tree6a8bee2d33245513feaa70b814c555da66c2641f
parent70a137b75e149611c101cb57e0322e370f669094
socket: Implement SO_RERROR

SO_RERROR indicates that receive buffer overflows should be handled as
errors. Historically receive buffer overflows have been ignored and
programs could not tell if they missed messages or messages had been
truncated because of overflows. Since programs historically do not
expect to get receive overflow errors, this behavior is not the
default.

This is really really important for programs that use route(4) to keep
in sync with the system. If we loose a message then we need to reload
the full system state, otherwise the behaviour from that point is
undefined and can lead to chasing bogus bug reports.

Reviewed by: philip (network), kbowling (transport), gbe (manpages)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26652

(cherry picked from commit 7045b1603bdf054145dd958a4acc17b410fb62a0)
21 files changed:
lib/libc/sys/getsockopt.2
sbin/route/route.c
sys/kern/uipc_sockbuf.c
sys/kern/uipc_socket.c
sys/kern/uipc_usrreq.c
sys/net/raw_usrreq.c
sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c
sys/netgraph/ng_socket.c
sys/netinet/ip_divert.c
sys/netinet/ip_mroute.c
sys/netinet/raw_ip.c
sys/netinet/udp_usrreq.c
sys/netinet6/icmp6.c
sys/netinet6/ip6_input.c
sys/netinet6/ip6_mroute.c
sys/netinet6/raw_ip6.c
sys/netinet6/send.c
sys/netinet6/udp6_usrreq.c
sys/netipsec/keysock.c
sys/sys/socket.h
sys/sys/socketvar.h