1
0
Fork 0
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:
Gerhard Rieger 2023-10-26 19:12:38 +02:00
parent 47af17dbf2
commit 11d1e9e11f
12 changed files with 185 additions and 42 deletions

View file

@ -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;
}