Browse Source

vpnc-scripts: Fix handling of multiple VPN DNS servers

Fix for #2116 - $INTERNAL_IP{4,6}_DNS variables are not word-split correctly when containing more than one DNS server.

Signed-off-by: Aleksandar Radovanovic <biblbroks@sezampro.rs>
lilik-openwrt-22.03
Aleksandar Radovanovic 9 years ago
parent
commit
00c9d9078a
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      net/vpnc-scripts/files/vpnc-script

+ 6
- 6
net/vpnc-scripts/files/vpnc-script View File

@ -91,12 +91,12 @@ do_connect() {
continue continue
fi fi
if [ -n "$INTERNAL_IP4_DNS" ];then if [ -n "$INTERNAL_IP4_DNS" ];then
for dns in "$INTERNAL_IP4_DNS";do
for dns in $INTERNAL_IP4_DNS;do
echo "server=/$i/$dns" >> $DNSMASQ_FILE echo "server=/$i/$dns" >> $DNSMASQ_FILE
done done
fi fi
if [ -n "$INTERNAL_IP6_DNS" ];then if [ -n "$INTERNAL_IP6_DNS" ];then
for dns in "$INTERNAL_IP6_DNS";do
for dns in $INTERNAL_IP6_DNS;do
echo "server=/$i/$dns" >> $DNSMASQ_FILE echo "server=/$i/$dns" >> $DNSMASQ_FILE
done done
fi fi
@ -105,23 +105,23 @@ do_connect() {
/etc/init.d/dnsmasq restart /etc/init.d/dnsmasq restart
else else
if [ -n "$INTERNAL_IP4_DNS" ];then if [ -n "$INTERNAL_IP4_DNS" ];then
for dns in "$INTERNAL_IP4_DNS";do
for dns in $INTERNAL_IP4_DNS;do
proto_add_dns_server "$dns" proto_add_dns_server "$dns"
done done
fi fi
if [ -n "$INTERNAL_IP6_DNS" ];then if [ -n "$INTERNAL_IP6_DNS" ];then
for dns in "$INTERNAL_IP6_DNS";do
for dns in $INTERNAL_IP6_DNS;do
proto_add_dns_server "$dns" proto_add_dns_server "$dns"
done done
fi fi
if [ -n "$CISCO_DEF_DOMAIN" ] && [ "$CISCO_DEF_DOMAIN" != "$LOCAL_DOMAIN" ];then if [ -n "$CISCO_DEF_DOMAIN" ] && [ "$CISCO_DEF_DOMAIN" != "$LOCAL_DOMAIN" ];then
if [ -n "$INTERNAL_IP4_DNS" ];then if [ -n "$INTERNAL_IP4_DNS" ];then
for dns in "$INTERNAL_IP4_DNS";do
for dns in $INTERNAL_IP4_DNS;do
echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE
done done
fi fi
if [ -n "$INTERNAL_IP6_DNS" ];then if [ -n "$INTERNAL_IP6_DNS" ];then
for dns in "$INTERNAL_IP6_DNS";do
for dns in $INTERNAL_IP6_DNS;do
echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE
done done
fi fi


Loading…
Cancel
Save