]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixed compile issues on FreeBSD and Solaris
authorDavid Sommerseth <davids@redhat.com>
Mon, 19 Sep 2011 14:43:04 +0000 (16:43 +0200)
committerDavid Sommerseth <davids@redhat.com>
Wed, 21 Sep 2011 13:04:50 +0000 (15:04 +0200)
In commit 7fb0e07ec3f7c5f6514523085dbe struct route changed and
this change was not fixed in all places in tun.c, which caused
a compilation error.  A few whitespace fixes is added as well.

OSX needs to be fixed as well, but this will be done in a separate patch.

Tested-by: Eric F Crist <ecrist@secure-computing.net> (FreeBSD)
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
tun.c

diff --git a/tun.c b/tun.c
index aa17c36aa40680d3ae86f9f45d5d0dd6df5b09bb..5e645ca7b9631603d7319def67a8231a57890e83 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -865,13 +865,12 @@ do_ifconfig (struct tuntap *tt,
          /* Add a network route for the local tun interface */
          struct route r;
          CLEAR (r);      
-         r.defined = true;       
+         r.flags = RT_DEFINED | RT_METRIC_DEFINED;
          r.network = tt->local & tt->remote_netmask;
          r.netmask = tt->remote_netmask;
          r.gateway = tt->local;  
-         r.metric_defined = true;
          r.metric = 0;
-         add_route (&r, tt, 0, es);
+         add_route (&r, tt, 0, NULL, es);
        }
 
       tt->did_ifconfig = true;
@@ -1105,21 +1104,21 @@ do_ifconfig (struct tuntap *tt,
                               ifconfig_remote_netmask,
                               tun_mtu
                               );
-       
+
       argv_msg (M_INFO, &argv);
       openvpn_execve_check (&argv, es, S_FATAL, "FreeBSD ifconfig failed");
       tt->did_ifconfig = true;
 
        /* Add a network route for the local tun interface */
       if (!tun && tt->topology == TOP_SUBNET)
-        {               
+        {
           struct route r;
-          CLEAR (r);      
-          r.defined = true;       
+          CLEAR (r);
+          r.flags = RT_DEFINED;
           r.network = tt->local & tt->remote_netmask;
           r.netmask = tt->remote_netmask;
-          r.gateway = tt->local;  
-          add_route (&r, tt, 0, es);
+          r.gateway = tt->local;
+          add_route (&r, tt, 0, NULL, es);
         }
 
       if ( do_ipv6 )