[PATCH] Fix ocserv tun read/write on FreeBSD

Brian Chu cynix at cynix.org
Sat Apr 4 07:31:36 PDT 2015

On Sun, Apr 5, 2015 at 1:04 AM, Nikos Mavrogiannopoulos <nmav at gnutls.org> wrote:
> On Sat, 2015-04-04 at 21:39 +1100, Brian Chu wrote:
>> Hi Nikos,
>> In commit 9d51069 you added handling for the additional 4-byte packet
>> header that's present on OpenBSD. However, this is broken on FreeBSD
>> because whilst TUNSIFHEAD is defined, it is not set by default. The
>> attached patch fixes this by setting this ioctl after creating the tun
>> device. I've also attached 2 trivial patches for fixing an extraneous
>> return value and indentation.
> Thanks. Wouldn't however be simpler to define TUN_AF_PREFIX only in
> OpenBSD then?

My understanding is that IPv6 won't work if TUNSIFHEAD is not set
(FreeBSD will assume the address family is AF_INET for all packets


More information about the openconnect-devel mailing list