From 79a5aa44ca30b0a9c5ba067f099bc1b97d8454e0 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 19 Sep 2011 16:43:04 +0200 Subject: [PATCH] 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 --- tun.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tun.c b/tun.c index aa17c36a..5e645ca7 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 )