Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jun 2005 21:51:31 +1200
From:      Matthew Luckie <mjl@luckie.org.nz>
To:        freebsd-current@freebsd.org
Subject:   BPF writes on DLT_NULL devices
Message-ID:  <42B14BA3.5050700@luckie.org.nz>

next in thread | raw e-mail | index | archive | help
Hi -current

I'm writing to see if I can find someone to review and commit a patch I 
submitted to PR 82157 as suggested by re@

http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/82157

The patch attempts to tidy up the mess that is BPF write on DLT_NULL 
devices.

Some of these devices are handy to write to, e.g. tun, gif, and gre.

There are a number of limitations and flaws in the -current code; namely
* not all DLT_NULL devices support bpf write, including gif and gre
* write() will fail if trying to send a packet larger than the IP MTU 
less 4 bytes, due to bpf_movein not taking into account the psuedo header
* if_loop.c checks for bpf write in if_simloop; however the only device 
passing a packet via BPF to that function is looutput, yet looutput will 
return EAFNOSUPPORT because AF_UNSPEC is not checked in that function.

Full details, including test code and a patch is available in the PR

Any takers?

Matthew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42B14BA3.5050700>