Pavlin,

Thanks for the patch.  Is there any reason why someone might not want to have
multicast turned on by default, i.e. is there any chance this could break
something?  Should it be controllable by an option?

James

Pavlin Radoslavov <pav...@icir.org> said:

> Hi!
> 
> [OS: OpenBSD-3.5]
> [openvpn: 2.0_beta5, 1.5]
> 
> It appears that openvpn doesn't enable the multicast flag for the
> tun interface on OpenBSD (on FreeBSD for example, the flag is always
> set). E.g., if I use:
> 
> openvpn --local <...> --remote <...> --ifconfig <...> <...> --dev tun0
> 
> Then the interface doesn't have the MULTICAST flag set:
> 
> tun0: flags=51<UP,POINTOPOINT,RUNNING> mtu 1500
>         inet ...
> 
> I believe the following simple patch (against 2.0_beta5) fixes the
> problem.
> 
> Thanks,
> Pavlin
> 
> --- tun.c.org Sun Jun 13 00:34:28 2004
> +++ tun.c     Tue Jun 15 23:24:58 2004
> @@ -1274,6 +1274,24 @@
>  open_tun (const char *dev, const char *dev_type, const char *dev_node, bool
ipv6, struct tuntap *tt)
>  {
>    open_tun_generic (dev, dev_type, dev_node, ipv6, true, true, tt);
> +
> +  /* Enable multicast on the interface */
> +  if (tt->fd >= 0)
> +    {
> +      struct tuninfo info;
> +
> +      if (ioctl (tt->fd, TUNGIFINFO, &info) < 0) {
> +     msg (M_WARN | M_ERRNO, "Can't get interface info: %s",
> +       strerror(errno));
> +      }
> +
> +      info.flags |= IFF_MULTICAST;
> +
> +      if (ioctl (tt->fd, TUNSIFINFO, &info) < 0) {
> +     msg (M_WARN | M_ERRNO, "Can't set interface info: %s",
> +       strerror(errno));
> +      }
> +    }
>  }
>  
>  void
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> Openvpn-devel mailing list
> Openvpn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
> 



-- 




Reply via email to