This commit reminded me one of my old ideas. Why not to make some
function that allow to change DLT on the fly?

Such as NetBSD's "bpf_change_type()"?

/*
 * Change the data link type of a interface.
 */
void
bpf_change_type(ifp, dlt, hdrlen)
        struct ifnet *ifp;
        u_int dlt, hdrlen;
{
        struct bpf_if *bp;

        for (bp = bpf_iflist; bp != NULL; bp = bp->bif_next) {
                if (bp->bif_driverp == (struct bpf_if **)&ifp->if_bpf)
                        break;
        }
        if (bp == NULL)
                panic("bpf_change_type");

        bp->bif_dlt = dlt;

/*
* Compute the length of the bpf header. This is not necessarily
* equal to SIZEOF_BPF_HDR because we want to insert spacing such
* that the network layer header begins on a longword boundary (for
* performance reasons and to alleviate alignment restrictions).
*/
bp->bif_hdrlen = BPF_WORDALIGN(hdrlen + SIZEOF_BPF_HDR) - hdrlen;
}


_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to