diff options
author | Katze Miau <miaukatzemiau@priveasy.de> | 2011-12-20 19:41:26 (GMT) |
---|---|---|
committer | Katze Miau <miaukatzemiau@priveasy.de> | 2011-12-20 19:41:26 (GMT) |
commit | 754907fd31da80d247432d02128bb4e9c79d31b0 (patch) | |
tree | c095c058ad651ffeee5c52cf73e680620827a21a | |
parent | bd1376e986bf8c6bb54741ab75b92d99b48c8339 (diff) |
remove all hardcoded references to FFJ IP range, use /etc/config/cloud instead
Replace the last bits of hardcoded FFJ IP range outside /etc/config -
residing in fsm inetable state transitions - with IP ranges calculated
from /etc/config/cloud.
-rw-r--r-- | files/common/etc/fsm/inetable/common_queen.sh | 3 | ||||
-rwxr-xr-x | files/common/etc/fsm/inetable/trans/queen.enter | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/files/common/etc/fsm/inetable/common_queen.sh b/files/common/etc/fsm/inetable/common_queen.sh index 86b3aba..1f66c68 100644 --- a/files/common/etc/fsm/inetable/common_queen.sh +++ b/files/common/etc/fsm/inetable/common_queen.sh @@ -7,7 +7,8 @@ DHCPLeaseTime=$((12 * 3600)) NodeId="$(cat /etc/nodeid)" oct3=$(ifconfig br-mesh | egrep -o 'inet addr:[0-9.]*'|cut -f3 -d.) [ -n "$oct3" ] -gwip=10.17.$oct3.1 +gwip=$(ipcalc.sh "$(uci get cloud.cur.net_mesh)" $(($oct3 * 256 + 1)) 1 \ + | grep ^START | cut -f2 -d=) we_own_our_ip () { [ "$(p2ptbl get $gwiptbl $oct3 | cut -sf2)" == "$NodeId" ] diff --git a/files/common/etc/fsm/inetable/trans/queen.enter b/files/common/etc/fsm/inetable/trans/queen.enter index 5d266a0..a2a3ebf 100755 --- a/files/common/etc/fsm/inetable/trans/queen.enter +++ b/files/common/etc/fsm/inetable/trans/queen.enter @@ -26,7 +26,8 @@ if [ -z "$oct3" ]; then # TODO: log warning about IPv4 addr space exhaustion fi [ -n "$oct3" ] -gwip=10.17.$oct3.1 +gwip=$(ipcalc.sh "$(uci get cloud.cur.net_mesh)" $(($oct3 * 256 + 1)) 1 \ + | grep ^START | cut -f2 -d=) p2ptbl update $gwiptbl $oct3 "queen\t$NodeId" br-mesh # activate gw mode |