mirror of
https://repo.or.cz/socat.git
synced 2025-07-08 21:36:34 +00:00
Corrected handling of IP_RECVERR
This commit is contained in:
parent
bc32acb5fe
commit
d84c22be7a
6 changed files with 177 additions and 28 deletions
14
xioread.c
14
xioread.c
|
@ -128,7 +128,12 @@ ssize_t xioread(xiofile_t *file, void *buff, size_t bufsiz) {
|
|||
#if HAVE_STRUCT_MSGHDR_MSGCONTROLLEN
|
||||
msgh.msg_controllen = sizeof(ctrlbuff);
|
||||
#endif
|
||||
if (xiogetpacketsrc(pipe->fd, &msgh) < 0) {
|
||||
if (xiogetpacketsrc(pipe->fd, &msgh,
|
||||
MSG_PEEK
|
||||
#ifdef MSG_TRUNC
|
||||
|MSG_TRUNC
|
||||
#endif
|
||||
) < 0) {
|
||||
return -1;
|
||||
}
|
||||
do {
|
||||
|
@ -325,7 +330,12 @@ ssize_t xioread(xiofile_t *file, void *buff, size_t bufsiz) {
|
|||
#if HAVE_STRUCT_MSGHDR_MSGCONTROLLEN
|
||||
msgh.msg_controllen = sizeof(ctrlbuff);
|
||||
#endif
|
||||
if (xiogetpacketsrc(pipe->fd, &msgh) < 0) {
|
||||
if (xiogetpacketsrc(pipe->fd, &msgh,
|
||||
MSG_PEEK
|
||||
#ifdef MSG_TRUNC
|
||||
|MSG_TRUNC
|
||||
#endif
|
||||
) < 0) {
|
||||
return -1;
|
||||
}
|
||||
xiodopacketinfo(&msgh, true, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue