mirror of
https://repo.or.cz/socat.git
synced 2025-07-03 20:16:32 +00:00
Use PACKET_IGNORE_OUTGOING when available; a few corrections and renamings for raw sockets and ancillary messages
This commit is contained in:
parent
47af17dbf2
commit
11d1e9e11f
12 changed files with 185 additions and 42 deletions
|
@ -111,13 +111,14 @@ int _xioopen_interface(const char *ifname,
|
|||
_xiointerface_apply_iff(xfd->fd, ifname, xfd->para.interface.iff_opts);
|
||||
|
||||
#ifdef PACKET_IGNORE_OUTGOING
|
||||
/* Raw socket may even provide packets that are outbound - we are not
|
||||
/* Raw socket might also provide packets that are outbound - we are not
|
||||
interested in these and disable this "feature" in kernel if possible */
|
||||
if (Setsockopt(xfd->fd, SOL_PACKET, PACKET_IGNORE_OUTGOING, &one, sizeof(one)) < 0) {
|
||||
Warn2("setsockopt(%d, SOL_PACKET, PACKET_IGNORE_OUTGOING, {1}): %s",
|
||||
xfd->fd, strerror(errno));
|
||||
}
|
||||
#endif
|
||||
#endif /*defined(PACKET_IGNORE_OUTGOING) */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue