Ticket #662: patch_tun.c_master

File patch_tun.c_master, 1.1 KB (added by pruy, 8 years ago)

Patch of tun.c against master as of 2016-02-26

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