[PATCH] ocserv: fix ipv6 tun control on OpenBSD

Nikos Mavrogiannopoulos n.mavrogiannopoulos at gmail.com
Wed May 25 05:01:49 PDT 2016


Hi,
 It seems that this patch fails to compile on freebsd. Could you
modify it in a way that it doesn't affect that build?

https://gitlab.com/ocserv/ocserv/builds/1503666

regards,
Nikos

On Wed, May 25, 2016 at 1:15 AM, Andrew Karpow <andy at ndyk.de> wrote:
> This fixes ipv6 tunnel support on OpenBSD. OpenBSD network stack doesn't
> enable the multicast flag on tun devices like FreeBSD - but this is
> obligatory for ipv6.
>
> Error message without this patch:
> main: tun.c:260: tun0: Error setting IPv6: Invalid argument
>
> Signed-off-by: Andrew Karpow <andy at ndyk.de>
> ---
>  src/tun.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/src/tun.c b/src/tun.c
> index c478690..a8d7740 100644
> --- a/src/tun.c
> +++ b/src/tun.c
> @@ -566,6 +566,28 @@ int open_tun(main_server_st * s, struct proc_st *proc)
>                 strlcpy(proc->tun_lease.name, devname(st.st_rdev, S_IFCHR), sizeof(proc->tun_lease.name));
>         }
>
> +       /* enable multicast for tun interface (OpenBSD) */
> +       {
> +               struct tuninfo inf;
> +               ret = ioctl(tunfd, TUNGIFINFO, &inf);
> +               if (ret < 0) {
> +                       e = errno;
> +                       mslog(s, NULL, LOG_ERR, "%s: TUNGIFINFO: %s\n",
> +                                       proc->tun_lease.name, strerror(e));
> +                       goto fail;
> +               }
> +
> +               inf.flags |= IFF_MULTICAST;
> +
> +               ret = ioctl(tunfd, TUNSIFINFO, &inf);
> +               if (ret < 0) {
> +                       e = errno;
> +                       mslog(s, NULL, LOG_ERR, "%s: TUNSIFINFO: %s\n",
> +                                       proc->tun_lease.name, strerror(e));
> +                       goto fail;
> +               }
> +       }
> +
>  #ifdef TUNSIFHEAD
>         {
>                 int i = 1;
> --
> 2.8.3
>
>
> _______________________________________________
> openconnect-devel mailing list
> openconnect-devel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/openconnect-devel



More information about the openconnect-devel mailing list