Support for macOS feth devices

Gert Doering gert at
Thu Jul 16 16:06:40 AEST 2020


On Thu, Jul 16, 2020 at 02:02:36PM +1000, Damien Miller wrote:
> Apparently there's also "utun" mentioned on this bug
> - it's used AFAIK to
> implement user-space PPP, so it seems like a good fit though I don't
> know whether it does L2. Conversely, the feth interface seems to be L2-
> only, so maybe we need both?

We use utun in OpenVPN, and as far as we know, it's only L3.

(So as of today, OpenVPN uses the tap kext for L2... reading this thread
with interest :-) )

> find and open a free /dev/bpfN device (brute force open from unit 1 up)
> ioctl bpf: BIOCSBLEN to set read buffer size, get back read packet size
> ioctl bpf: BIOCIMMEDIATE/1 to disable bpf buffering in kernel
> ioctl bpf: BIOCSSEESENT/0 to disable interception of sent packets
> ioctl bpf: BIOCSHDRCMPLT/1 to disable lladdr completion
> ioctl bpf: BIOCPROMISC/1 to enable promiscuous mode
> ioctl bpf: BIOCSETIF to set peer interface (feth5000)
> then read packets on the bpf fd as per usual, write packets on the
> socket.

This looks wacky, having two different FDs for reading and writing...

What happens if you read() (or rcvmsg()) from the socket fd?

"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             gert at

More information about the openssh-unix-dev mailing list