Ticket #662: patch_openvpn_tun.c

File patch_openvpn_tun.c, 1.1 KB (added by pruy, 8 years ago)

Patch to tun.c

Line 
1--- src/openvpn/tun.c.orig   2014-11-29 15:00:35.000000000 +0000
2+++ src/openvpn/tun.c
3@@ -967,13 +967,12 @@ do_ifconfig (struct tuntap *tt,
4        if ( tt->topology == TOP_SUBNET )
5        {
6            argv_printf (&argv,
7-                         "%s %s %s %s mtu %d netmask %s up",
8+                         "%s %s %s netmask %s mtu %d up",
9                          IFCONFIG_PATH,
10                          actual,
11                          ifconfig_local,
12-                         ifconfig_local,
13-                         tun_mtu,
14-                         ifconfig_remote_netmask
15+                         ifconfig_remote_netmask,
16+                         tun_mtu
17                          );
18        }
19       else
20@@ -2164,7 +2193,7 @@ open_tun (const char *dev, const char *d
21 
22     if (tt->fd >= 0)
23       {
24-        int i = IFF_POINTOPOINT|IFF_MULTICAST;
25+        int i = (tt->topology == TOP_SUBNET : IFF_BROADCAST : IFF_POINTOPOINT)|IFF_MULTICAST;
26         ioctl (tt->fd, TUNSIFMODE, &i);  /* multicast on */
27         i = 0;
28         ioctl (tt->fd, TUNSLMODE, &i);   /* link layer mode off */