vpnc-script: don't attempt to resolve domains which match the local domain
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 24 Nov 2015 23:23:43 +0000 (00:23 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 28 Nov 2015 21:40:19 +0000 (22:40 +0100)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
net/vpnc-scripts/files/vpnc-script

index 7660d9c6d6c24bd8109657c730da847593316364..7af5074d98636f85d7024403961773f39d94c840 100755 (executable)
@@ -82,10 +82,14 @@ do_connect() {
        fi
 
        DNSMASQ_FILE="/tmp/dnsmasq.d/openconnect.$TUNDEV"
+       LOCAL_DOMAIN=$(uci get dhcp.@dnsmasq[0].domain)
        rm -f $DNSMASQ_FILE
        if [ -n "$CISCO_SPLIT_DNS" ] && [ -d "/tmp/dnsmasq.d/" ];then
                SDNS=`echo $CISCO_SPLIT_DNS|sed 's/,/\n/g'`
                echo "$SDNS" | while read i; do
+                       if [ "$i" = "$LOCAL_DOMAIN" ];then
+                               continue
+                       fi
                        if [ -n "$INTERNAL_IP4_DNS" ];then
                                for dns in "$INTERNAL_IP4_DNS";do
                                        echo "server=/$i/$dns" >> $DNSMASQ_FILE
@@ -110,7 +114,7 @@ do_connect() {
                                proto_add_dns_server "$dns"
                        done
                fi
-               if [ -n "$CISCO_DEF_DOMAIN" ];then
+               if [ -n "$CISCO_DEF_DOMAIN" ] && [ "$CISCO_DEF_DOMAIN" != "$LOCAL_DOMAIN" ];then
                        if [ -n "$INTERNAL_IP4_DNS" ];then
                                for dns in "$INTERNAL_IP4_DNS";do
                                        echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE