tcpdump mailing list archives

Re: pcap_inject() on loopback (FreeBSD)


From: Guy Harris <guy () alum mit edu>
Date: Mon, 16 Jun 2014 03:17:41 -0700


On Jun 16, 2014, at 2:50 AM, Guy Harris <guy () alum mit edu> wrote:

On Jun 15, 2014, at 1:56 PM, Fernando Gont <fernando () gont com ar> wrote:

I will certainly file a bug report, and CC you. My understanding is that
this should be filled in most (if not all) of the BSD variants? (because
besides the error message one obtains, it seems that in several flavors
of them, pcap_inject() fails for the same reason).

NetBSD, OpenBSD, and Dragonfly BSD appear not to even have the ...

...and OpenBSD may need to do

        /* BPF writes need to be handled specially. */
        if (dst->sa_family == pseudo_AF_HDRCMPLT) {
                bcopy(dst->sa_data, &af, sizeof(af));
                af = ntohl(af);
        } else
                af = dst->sa_family;

as its loopback device has a DLT_ of DLT_LOOP rather than DLT_NULL and, with DLT_LOOP, the 4-byte AF_ header of the 
packet is in *network* byte order rather than *host* byte order.
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Current thread: