#21361: vpnc-scripts incorrectly handle multiple DNS servers per domain
-----------------------+--------------------------------
Reporter: biblbroks | Owner: developers
Type: defect | Status: new
Priority: normal | Milestone:
Component: packages | Version: Chaos Calmer 15.05
Keywords: |
-----------------------+--------------------------------
I have an openconnect setup where the server pushes a split DNS setup with
two DNS servers for VPN DNS domain.
/lib/netifd/vpnc-script from vpnc-scripts package (both in 15.05 and
trunk) does not handle this configuration correctly.
The problem is in the following bit of shell code that handles DNS
variables:
{{{
if [ -n "$INTERNAL_IP4_DNS" ];then
for dns in "$INTERNAL_IP4_DNS";do
echo "server=/$i/$dns" >> $DNSMASQ_FILE
done
fi
}}}
Since $INTERNAL_IP4_DNS variable inside the 'for' statement is in double
quotes, it does not get word split and this generates:
{{{
server=/foo.bar/1.2.3.4 5.6.7.8
}}}
which is invalid syntax for dnsmasq.conf and causes subsequent
/etc/init.d/dnsmasq restart to barf, essentially killing all DHCP and DNS
on the router.
A simple fix is to remove double quotes surrounding the variable in the
'for' statement (but, of course, not in the 'if' statement above). Note
that there is more then one place in the script where this issue is
present. With that fix in place, dnsmasq.conf is correctly generated and
everything works as expected.
--
Ticket URL: <https://dev.openwrt.org/ticket/21361>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets