tcpdump mailing list archives
Re: pcap_inject() fails with rc 0 on HP-UX
From: Guy Harris <guy () alum mit edu>
Date: Mon, 03 Apr 2006 22:44:12 -0700
Harley Stenzel wrote:
However, on HP-UX, that same call returns rc 0. I was not able to find a pre-existing bug for this problem, however I was able to find this message: http://www.tcpdump.org/lists/workers/2004/03/msg00103.html indicating that at least in 2004, HP-UX send would not work.
The #ifdeffed-out code was replaced since then.
2) It's not clear under what circumstances a rc 0 could ever be returned. Only on retrun from write() or dlrawdatareq() could rc be 0.
dlrawdatareq() returns the return value of putmsg(), and putmsg() returns 0 on success.
I've checked into the main and x.9 branches a change to, on HP-UX, have the inject routine return, on success, the number of bytes it was asked to write. That should at least fix that problem. (Workaround: use pcap_sendpacket(), which is defined to return 0 on success.)
3) I ported libnet's transmission code into pcap_inject_dlpi(). It still does not work, but the failure mode is different -- it reports the number of octets written correctly, but the frame is still not on the wire.
I infer from "still not on the wire" that the frame didn't appear on the wire with standard libpcap, either. Is that the case? If so, my change won't fix that - it just changes what's returned to match the pcap_inject() API.
- This is the tcpdump-workers list. Visit https://lists.sandelman.ca/ to unsubscribe.
Current thread:
- pcap_inject() fails with rc 0 on HP-UX Harley Stenzel (Apr 03)
- Re: pcap_inject() fails with rc 0 on HP-UX Rick Jones (Apr 03)
- Re: pcap_inject() fails with rc 0 on HP-UX Harley Stenzel (Apr 04)
- Re: pcap_inject() fails with rc 0 on HP-UX Guy Harris (Apr 04)
- Re: pcap_inject() fails with rc 0 on HP-UX Harley Stenzel (Apr 04)
- Re: pcap_inject() fails with rc 0 on HP-UX Guy Harris (Apr 03)
- Re: pcap_inject() fails with rc 0 on HP-UX Harley Stenzel (Apr 07)
- Re: pcap_inject() fails with rc 0 on HP-UX Rick Jones (Apr 03)