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

Reply via email to