summaryrefslogtreecommitdiff
path: root/print-null.c
diff options
context:
space:
mode:
authorguy <guy>2000-12-16 10:57:26 +0000
committerguy <guy>2000-12-16 10:57:26 +0000
commit86eb0bec355624d73cc98ae26e36328915335350 (patch)
treee27b247f1cf04439f4b903df0bfd32a410dd815f /print-null.c
parentf243e70b91b9a25a4cda052f37f48fb5aa49bf39 (diff)
downloadtcpdump-86eb0bec355624d73cc98ae26e36328915335350.tar.gz
Clean up promiscuous mode, when using SOCK_PACKET, as best we can;
remember which pcap_t's were opened (with SOCK_PACKET) in promiscuous mode on interfaces not already in promiscuous mode, turn promiscuous mode off when closing such a pcap_t, and arrange that, when the program exits, all pcap_t's of that sort not already closed have their interfaces taken out of promiscuous mode. (It's not sufficient to do this on exit - applications may close a pcap_t without exiting, e.g. Ethereal.) This won't always work right (if somebody else requests promiscuous mode after it's opened by libpcap, we'll turn promiscuous mode off when we close the pcap_t, and if the program doesn't exit cleanly, it won't clean up the interfaces), but neither of those problems are fixable - the only way to get things to work correctly is to use PF_PACKET sockets, which requires a 2.2 or later kernel. On a 2.0[.x] kernel, when doing a "recvfrom()" on a SOCK_PACKET socket to read a captured packet, don't pass a byte count value based on the snapshot length - "recvfrom()" won't return the actual packet length if you do that. (2.2 and later kernels will return the actual packet length if MSG_TRUNC is passed in.) Update the documentation to reflect improved Appletalk support.
Diffstat (limited to 'print-null.c')
0 files changed, 0 insertions, 0 deletions