aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/ipv6/ds-lite/files
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2016-10-06 09:13:40 +0200
committerJo-Philipp Wich <jo@mein.io>2016-10-06 12:16:12 +0200
commit34528c4807de017c359d87d0cd3c415cc0ae1893 (patch)
tree371e209e81973b3dabce089f553d0d79f2803f9b /package/network/ipv6/ds-lite/files
parent7694c5cf0edc51e7a9cea188143c6fef2f38f442 (diff)
downloadupstream-34528c4807de017c359d87d0cd3c415cc0ae1893.tar.gz
upstream-34528c4807de017c359d87d0cd3c415cc0ae1893.tar.bz2
upstream-34528c4807de017c359d87d0cd3c415cc0ae1893.zip
dslite: Quote resolveip hostname argument
Quote resolveip hostname argument to avoid bad shell injections. While at it fix pattern match logic in case multiple IPv6 addresses are returned for a hostname as they're seperated by newline by resolveip and not a white space Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'package/network/ipv6/ds-lite/files')
-rwxr-xr-xpackage/network/ipv6/ds-lite/files/dslite.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/package/network/ipv6/ds-lite/files/dslite.sh b/package/network/ipv6/ds-lite/files/dslite.sh
index a7e0a10542..2485a424dc 100755
--- a/package/network/ipv6/ds-lite/files/dslite.sh
+++ b/package/network/ipv6/ds-lite/files/dslite.sh
@@ -26,16 +26,20 @@ proto_dslite_setup() {
( proto_add_host_dependency "$cfg" "::" "$tunlink" )
- remoteip6=$(resolveip -6 $peeraddr)
+ remoteip6=$(resolveip -6 "$peeraddr")
if [ -z "$remoteip6" ]; then
sleep 3
- remoteip6=$(resolveip -6 $peeraddr)
+ remoteip6=$(resolveip -6 "$peeraddr")
if [ -z "$remoteip6" ]; then
proto_notify_error "$cfg" "AFTR_DNS_FAIL"
return
fi
fi
- peeraddr="${remoteip6%% *}"
+
+ for ip6 in $remoteip6; do
+ peeraddr=$ip6
+ break
+ done
[ -z "$ip6addr" ] && {
local wanif="$tunlink"