[PATCH] Avoiding segfault in Snow Leopard when not using -i option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am testing openconnect on Mac OS X (Snow Leopard, 10.6.2) and experienced a problem when connecting using the example in the documentation (openconnect --script /etc/vpnc/vpnc-script https://vpn.mycompany.com/) - 
openconnect crashed because of a segmentation violation. I compiled openconnect from HEAD in the Git repository. Using the -i option to specify the tun interface was an acceptable workaround for me, but nevertheless, I submit a patch.

 - j?rgen


Signed-off-by: J?rgen Wahlberg <jorgen at jaws.no>

diff --git a/tun.c b/tun.c
index cdae108..2c33386 100644
--- a/tun.c
+++ b/tun.c
@@ -239,7 +239,8 @@ static void set_script_env(struct openconnect_info *vpninfo)
                              sizeof(host), NULL, 0, NI_NUMERICHOST);
        if (!ret)
                setenv("VPNGATEWAY", host, 1);
-       setenv("TUNDEV", vpninfo->ifname, 1);
+       if (vpninfo->ifname)
+           setenv("TUNDEV", vpninfo->ifname, 1);
        setenv("reason", "connect", 1);
        unsetenv("CISCO_BANNER");
        unsetenv("CISCO_SPLIT_INC");






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux