diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-02-04 10:32:11 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-02-04 10:32:11 -0800 |
commit | 9b1c06a0ead9114701e2871c7e2aff106ba92c6b (patch) | |
tree | 106ebf1e690b35393cc0d261f4721c5453c2ba87 /pcap_loop.3pcap | |
parent | 22eef87593a3bf07bbe91b2b3d98da2af9519f77 (diff) |
Clarify the lifetime of the packet header and data when reading packets.
(Yes, I know - I'm using "data" as a collective noun. :-))
Diffstat (limited to 'pcap_loop.3pcap')
-rw-r--r-- | pcap_loop.3pcap | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pcap_loop.3pcap b/pcap_loop.3pcap index 70cfaa02..da306931 100644 --- a/pcap_loop.3pcap +++ b/pcap_loop.3pcap @@ -109,7 +109,12 @@ pointer to the first (as given in the .I struct pcap_pkthdr a pointer to which is passed to the callback routine) -bytes of data from the packet. +bytes of data from the packet. The +.I struct pcap_pkthdr +and the packet data are not to be freed by the callback routine, and are +not guaranteed to be valid after the callback routine returns; if the +code needs them to be valid after the callback, it must make a copy of +them. .SH RETURN VALUE .B pcap_loop() returns 0 if |