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.
1 file changed
tree: e27b247f1cf04439f4b903df0bfd32a410dd815f
  1. lbl/
  2. missing/
  3. .cvsignore
  4. acconfig.h
  5. aclocal.m4
  6. addrtoname.c
  7. addrtoname.h
  8. ah.h
  9. appletalk.h
  10. atime.awk
  11. bootp.h
  12. bpf_dump.c
  13. CHANGES
  14. chdlc.h
  15. config.guess
  16. config.h.in
  17. config.sub
  18. configure
  19. configure.in
  20. CREDITS
  21. decnet.h
  22. dhcp6.h
  23. dhcp6opt.h
  24. esp.h
  25. ether.h
  26. ethertype.h
  27. extract.h
  28. fddi.h
  29. FILES
  30. gmt2local.c
  31. gmt2local.h
  32. icmp6.h
  33. igrp.h
  34. INSTALL
  35. install-sh
  36. interface.h
  37. ip.h
  38. ip6.h
  39. ipsec_doi.h
  40. ipx.h
  41. isakmp.h
  42. l2tp.h
  43. lane.h
  44. LICENSE
  45. llc.h
  46. machdep.c
  47. machdep.h
  48. Makefile-devel-adds
  49. Makefile.in
  50. makemib
  51. mib.h
  52. mkdep
  53. nameser.h
  54. netbios.h
  55. nfs.h
  56. nfsfh.h
  57. ntp.h
  58. oakley.h
  59. ospf.h
  60. ospf6.h
  61. packetdat.awk
  62. parsenfsfh.c
  63. PLATFORMS
  64. ppp.h
  65. print-ah.c
  66. print-arp.c
  67. print-ascii.c
  68. print-atalk.c
  69. print-atm.c
  70. print-bgp.c
  71. print-bootp.c
  72. print-bxxp.c
  73. print-cdp.c
  74. print-chdlc.c
  75. print-cip.c
  76. print-cnfp.c
  77. print-decnet.c
  78. print-dhcp6.c
  79. print-domain.c
  80. print-dvmrp.c
  81. print-egp.c
  82. print-esp.c
  83. print-ether.c
  84. print-fddi.c
  85. print-frag6.c
  86. print-gre.c
  87. print-icmp.c
  88. print-icmp6.c
  89. print-igmp.c
  90. print-igrp.c
  91. print-ip.c
  92. print-ip6.c
  93. print-ip6opts.c
  94. print-ipcomp.c
  95. print-ipx.c
  96. print-isakmp.c
  97. print-isoclns.c
  98. print-krb.c
  99. print-l2tp.c
  100. print-lane.c
  101. print-lcp.c
  102. print-llc.c
  103. print-mobile.c
  104. print-netbios.c
  105. print-nfs.c
  106. print-ntp.c
  107. print-null.c
  108. print-ospf.c
  109. print-ospf6.c
  110. print-pim.c
  111. print-ppp.c
  112. print-pppoe.c
  113. print-radius.c
  114. print-raw.c
  115. print-rip.c
  116. print-ripng.c
  117. print-rt6.c
  118. print-rx.c
  119. print-sl.c
  120. print-smb.c
  121. print-snmp.c
  122. print-stp.c
  123. print-sunrpc.c
  124. print-tcp.c
  125. print-telnet.c
  126. print-tftp.c
  127. print-timed.c
  128. print-token.c
  129. print-udp.c
  130. print-vjc.c
  131. print-vrrp.c
  132. print-wb.c
  133. README
  134. route6d.h
  135. rx.h
  136. savestr.c
  137. savestr.h
  138. send-ack.awk
  139. setsignal.c
  140. setsignal.h
  141. slcompress.h
  142. slip.h
  143. smb.h
  144. smbutil.c
  145. stime.awk
  146. strcasecmp.c
  147. tcp.h
  148. tcpdump.1
  149. tcpdump.c
  150. timed.h
  151. TODO
  152. token.h
  153. udp.h
  154. util.c
  155. VERSION
  156. vfprintf.c