]> The Tcpdump Group git mirrors - tcpdump/commit
Move some code to better show how to handle pcap_activate() failure.
authorGuy Harris <[email protected]>
Sun, 24 Nov 2019 03:28:01 +0000 (19:28 -0800)
committerGuy Harris <[email protected]>
Sun, 24 Nov 2019 03:28:17 +0000 (19:28 -0800)
commitcbd0d78fce1b7ef6019cb6cb7c3b2dc3393bdbd2
tree411bafb4ed6d01f86139736f0ca2a63471a17d55
parent6f531302736fa22264dce423234deeb4d5a4fed6
Move some code to better show how to handle pcap_activate() failure.

If you call pcap_activate() and it fails, you still have a pcap_t from
pcap_create(), and should close it.

Moving the code after the error() calls doesn't make a difference, as
error() exits, but it may make it clearer to those reading tcpdump.c for
help in figuring out how to use libpcap that you should close the pcap_t
if pcap_activate() fails.

(In the future, there may also be the option of changing some options
and trying again, e.g. changing the user name or password for a remote
capture.)
tcpdump.c