1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-18 00:53:25 +00:00

new address "interface" for transparent network interface handling

This commit is contained in:
Gerhard Rieger 2008-09-20 23:37:56 +02:00
parent d70b8963aa
commit de910892f2
18 changed files with 300 additions and 31 deletions

View file

@ -131,6 +131,15 @@ ssize_t xioread(xiofile_t *file, void *buff, size_t bufsiz) {
errno = _errno;
return -1;
}
/* on packet type we also receive outgoing packets, this is not desired
*/
if (from.soa.sa_family == PF_PACKET) {
if ((((struct sockaddr_ll *)&from.soa)->sll_pkttype & PACKET_OUTGOING)
== 0) {
errno = EAGAIN; return -1;
}
}
Notice2("received packet with "F_Zu" bytes from %s",
bytes,
sockaddr_info(&from.soa, fromlen, infobuff, sizeof(infobuff)));