6rd: pass ipcalc as argument to eval
authorHans Dedecker <dedeckeh@gmail.com>
Sat, 13 Jan 2018 10:05:46 +0000 (11:05 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 15 Jan 2018 08:49:26 +0000 (09:49 +0100)
Instead of grepping for NETWORK after calling ipcalc.sh; pass ipcalc.sh as
argument to eval allowing to use $NETWORK to retrieve the IPv4 prefix
(ip4prefix).

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
package/network/ipv6/6rd/Makefile
package/network/ipv6/6rd/files/6rd.sh

index 5086fae69d29619a81c6604715ebf2c4af86eb72..47f20414fc7663b0fc2aab919bea17cc44bf10ad 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6rd
 PKG_VERSION:=9
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index 8b34414280fbd0e020b15fc984155f0e42e5cd6e..62a20314d9322b56a3785f9f4b5adf7523a2460d 100644 (file)
@@ -40,8 +40,8 @@ proto_6rd_setup() {
 
        # Determine the relay prefix.
        local ip4prefixlen="${ip4prefixlen:-0}"
-       local ip4prefix=$(ipcalc.sh "$ipaddr/$ip4prefixlen" | grep NETWORK)
-       ip4prefix="${ip4prefix#NETWORK=}"
+       local ip4prefix
+       eval "$(ipcalc.sh "$ipaddr/$ip4prefixlen")";ip4prefix=$NETWORK
 
        # Determine our IPv6 address.
        local ip6subnet=$(6rdcalc "$ip6prefix/$ip6prefixlen" "$ipaddr/$ip4prefixlen")