From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id DBD6A385742A; Mon, 11 Jul 2022 11:53:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBD6A385742A Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] SO_RERROR indicates that receive buffer overflows X-Act-Checkin: newlib-cygwin X-Git-Author: Alexander V. Chernikov X-Git-Refname: refs/heads/master X-Git-Oldrev: 8054ce555fdcd5fe9c2ad75cff6cd80218c9d0b1 X-Git-Newrev: 2ba2e1e052fee6fcde09efc1aacd29a83de366a3 Message-Id: <20220711115354.DBD6A385742A@sourceware.org> Date: Mon, 11 Jul 2022 11:53:54 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 11:53:55 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D2ba2e1e052f= ee6fcde09efc1aacd29a83de366a3 commit 2ba2e1e052fee6fcde09efc1aacd29a83de366a3 Author: Alexander V. Chernikov Date: Sun Feb 7 17:21:18 2021 +0000 SO_RERROR indicates that receive buffer overflows =20 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. =20 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. Diff: --- newlib/libc/sys/rtems/include/sys/socket.h | 1 + 1 file changed, 1 insertion(+) diff --git a/newlib/libc/sys/rtems/include/sys/socket.h b/newlib/libc/sys/r= tems/include/sys/socket.h index 4079b3e91..54cd0be93 100644 --- a/newlib/libc/sys/rtems/include/sys/socket.h +++ b/newlib/libc/sys/rtems/include/sys/socket.h @@ -139,6 +139,7 @@ typedef __uintptr_t uintptr_t; #define SO_NO_OFFLOAD 0x00004000 /* socket cannot be offloaded */ #define SO_NO_DDP 0x00008000 /* disable direct data placement */ #define SO_REUSEPORT_LB 0x00010000 /* reuse with load balancing */ +#define SO_RERROR 0x00020000 /* keep track of receive errors */ =20 /* * Additional options, not kept in so_options.