]> The Tcpdump Group git mirrors - libpcap/commit
NPF: move the "fetch time stamp types" code to its own routine.
authorGuy Harris <[email protected]>
Sun, 20 Feb 2022 07:31:45 +0000 (23:31 -0800)
committerGuy Harris <[email protected]>
Mon, 21 Feb 2022 00:00:17 +0000 (16:00 -0800)
commit746f93d2fc0dc7ae8a083d8a8b873614ac83d32c
tree1985fab8d0b450aed40659853783a1e6587a80d6
parenta288cc139019e5cf50ccf7585e5e0f70019496c7
NPF: move the "fetch time stamp types" code to its own routine.

That cleans the code up a bit.

We also have a version of that routine that does nothing, and use it if
we *don't* have PacketGetTimestampModes().  That removes an #ifdef from
pcap_create_interfaces().

We can just use pcap_close() if get_ts_types() fails, as its
cleanup_op() was set to the default value of pcap_cleanup_live_common(),
which will free up the time stamp type list if it's been allocated.

This all matches how we do this in pcap-linux.c.

(cherry picked from commit 4b4d277d069df47615a13b19f623fb864a97d51f)
pcap-npf.c