[tcpdump-workers] libpcap picks up sent packets on freebsd (plus link state query)

mate csaba matecs at niif.hu
Thu Jan 7 05:20:28 EST 2016


hi,
i'm developing a router (rtros.nop.hu) which uses libpcap to capture and 
send packets to interfaces.
the interface handler can be found here: 
http://sources.nop.hu/src/zzz/nat-pcapInt.c
it's an interface<---->udp socket converter tool: when a packet 
captured, it'll be sent
to the udp, when a packet received from the udp, it'll be sent to the 
interface.
it works fine on linux for years. now i've noticed that on 
debian/sid/kfreebsd,
when i send a packet to the interface, it's get captured.
could you give me hints how to avoid it in a platform independent manner?
anyway, should i workaround it somehow, or it's an issue of libpcap?
and a bonus feature request (?):
could you please provide an api for interface up/down states?
that would be very useful for me in the same piece of code.
thanks,
csaba mate
as1955



More information about the tcpdump-workers mailing list