6rd: pass ipcalc as argument to eval

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>
openwrt-18.06
Hans Dedecker 2018-01-13 11:05:46 +01:00
parent e15c63a375
commit 4e48230954
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=6rd PKG_NAME:=6rd
PKG_VERSION:=9 PKG_VERSION:=9
PKG_RELEASE:=3 PKG_RELEASE:=4
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View File

@ -40,8 +40,8 @@ proto_6rd_setup() {
# Determine the relay prefix. # Determine the relay prefix.
local ip4prefixlen="${ip4prefixlen:-0}" local ip4prefixlen="${ip4prefixlen:-0}"
local ip4prefix=$(ipcalc.sh "$ipaddr/$ip4prefixlen" | grep NETWORK) local ip4prefix
ip4prefix="${ip4prefix#NETWORK=}" eval "$(ipcalc.sh "$ipaddr/$ip4prefixlen")";ip4prefix=$NETWORK
# Determine our IPv6 address. # Determine our IPv6 address.
local ip6subnet=$(6rdcalc "$ip6prefix/$ip6prefixlen" "$ipaddr/$ip4prefixlen") local ip6subnet=$(6rdcalc "$ip6prefix/$ip6prefixlen" "$ipaddr/$ip4prefixlen")