From: David Sommerseth Date: Mon, 19 Sep 2011 14:43:04 +0000 (+0200) Subject: Fixed compile issues on FreeBSD and Solaris X-Git-Tag: v2.3-alpha1~183 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79a5aa44ca30b0a9c5ba067f099bc1b97d8454e0;p=thirdparty%2Fopenvpn.git Fixed compile issues on FreeBSD and Solaris 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 (FreeBSD) Acked-by: Gert Doering Signed-off-by: David Sommerseth --- diff --git a/tun.c b/tun.c index aa17c36aa..5e645ca7b 100644 --- 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 )