Browse Source

vpnc-script: create dnsmasq entries for connections where default domain is set

Relates to #1975

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Nikos Mavrogiannopoulos 9 years ago
parent
commit
1f9b054deb
2 changed files with 16 additions and 4 deletions
  1. 1
    1
      net/vpnc-scripts/Makefile
  2. 15
    3
      net/vpnc-scripts/files/vpnc-script

+ 1
- 1
net/vpnc-scripts/Makefile View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=vpnc-scripts
11 11
 PKG_VERSION:=20150116
12
-PKG_RELEASE:=2
12
+PKG_RELEASE:=3
13 13
 
14 14
 include $(INCLUDE_DIR)/package.mk
15 15
 

+ 15
- 3
net/vpnc-scripts/files/vpnc-script View File

@@ -81,10 +81,10 @@ do_connect() {
81 81
 		[[ "$addr" != "$mask" ]] && proto_add_ipv6_address "$addr" "$mask"
82 82
 	fi
83 83
 
84
+	DNSMASQ_FILE="/tmp/dnsmasq.d/openconnect.$TUNDEV"
85
+	rm -f $DNSMASQ_FILE
84 86
 	if [ -n "$CISCO_SPLIT_DNS" ] && [ -d "/tmp/dnsmasq.d/" ];then
85 87
 		SDNS=`echo $CISCO_SPLIT_DNS|sed 's/,/\n/g'`
86
-		DNSMASQ_FILE="/tmp/dnsmasq.d/openconnect.$TUNDEV"
87
-		rm -f $DNSMASQ_FILE
88 88
 		echo "$SDNS" | while read i; do
89 89
 			if [ -n "$INTERNAL_IP4_DNS" ];then
90 90
 				for dns in "$INTERNAL_IP4_DNS";do
@@ -110,7 +110,19 @@ do_connect() {
110 110
 				proto_add_dns_server "$dns"
111 111
 			done
112 112
 		fi
113
-		[ -n "$CISCO_DEF_DOMAIN" ] && proto_add_dns_search "$CISCO_DEF_DOMAIN"
113
+		if [ -n "$CISCO_DEF_DOMAIN" ];then
114
+			if [ -n "$INTERNAL_IP4_DNS" ];then
115
+				for dns in "$INTERNAL_IP4_DNS";do
116
+					echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE
117
+				done
118
+			fi
119
+			if [ -n "$INTERNAL_IP6_DNS" ];then
120
+				for dns in "$INTERNAL_IP6_DNS";do
121
+					echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE
122
+				done
123
+			fi
124
+			proto_add_dns_search "$CISCO_DEF_DOMAIN"
125
+		fi
114 126
 	fi
115 127
 
116 128
 	if [ -n "$CISCO_SPLIT_INC" ]; then