PF_PACKET + bind() to proto + outbound packets
Subsystems (2)
I'm writing a small traffic watching program, to capture IPv4 packets.
If I have a PF_PACKET socket bound to no particular protocol it sees both inbound and outbound packets; I can then apply a BPF filter for just one protocol (i.e. IPv4).
But if instead I bind the socket to the IPv4 protocol specifically, it no longer sees any outbound packets created by the machine, only inbound ones.
Is there perhaps some ioctl or sockopt I could enable, to see these outbound packets too?
Further, would there actually be much difference in practice, in terms of performance, abilities, etc... even if this were an option turned on? What's the preferred method of snooping on all of the machine's, for example, IPv4 traffic?
Signature · 5 lines
Paul "LeoNerd" Evans [email protected] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/