let tun use bpf_mtap for handling input packets.
authordlg <dlg@openbsd.org>
Sat, 20 Feb 2021 04:39:16 +0000 (04:39 +0000)
committerdlg <dlg@openbsd.org>
Sat, 20 Feb 2021 04:39:16 +0000 (04:39 +0000)
commit42c39955505ea190778ba65078be50559edcc1d9
tree29c0492fb8d61dcce99638081566436d47dd5b43
parent4a6e2859c993caade441dd378b49d622981a2511
let tun use bpf_mtap for handling input packets.

tun (not tap) input packets are written from userland in the same
format that it's bpf dlt is expecting, so we can push the packet
straight into bpf with bpf_mtap. this is more correct that using
bpf_mtap_ether for tun.
sys/net/if_tun.c