summaryrefslogtreecommitdiff
path: root/files/common/etc/fsm/inetable/common.sh
diff options
context:
space:
mode:
authorKatze Miau <miaukatzemiau@priveasy.de>2011-12-11 13:32:54 (GMT)
committerKatze Miau <miaukatzemiau@priveasy.de>2011-12-11 13:32:54 (GMT)
commited254615ad04befe9f847879b3d78567c51f673b (patch)
treecee5bfabbb6a9aa707acd5e575ecfd195134c258 /files/common/etc/fsm/inetable/common.sh
parent586b5073ab8b0b745e627a3e246e45e4052e6f8d (diff)
fsm inetable: sync mesh iface w/ uci, use batctl gw off, reduce redundancy
- add mesh_add/del_ipv4 to set/unset IPv4 addresses of mesh iface; the address is set using ifconfig to avoid ifudown+ifup but also updated in UCI to maintain a consistent state - use this function in queen, ghost and robinson state transitions - use `batctl gw off` in robinson state: this allows to deliever local DHCP replies while dropping the idea of announcing fake gateways - ghost.leave reuses queen.leave
Diffstat (limited to 'files/common/etc/fsm/inetable/common.sh')
-rw-r--r--files/common/etc/fsm/inetable/common.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/files/common/etc/fsm/inetable/common.sh b/files/common/etc/fsm/inetable/common.sh
index 7c73837..148c369 100644
--- a/files/common/etc/fsm/inetable/common.sh
+++ b/files/common/etc/fsm/inetable/common.sh
@@ -1,5 +1,25 @@
cloud_is_online () {
# look for mac addrs in batman gateway list
- # TODO: remove fake gws with almost zero bandwith
batctl gwl | tail -n-1 | egrep -q '([0-9a-f]{2}:){5}[0-9a-f]{2}'
}
+
+## add/remove IPv4 address from mesh iface
+# manual update to avoid full ifdown+ifup, but update uci state for
+# other users (e.g. dnsmasq)
+mesh_add_ipv4 () {
+ ifconfig br-mesh $1 netmask $2
+ echo "
+set network.mesh.ipaddr=$1
+set network.mesh.proto=static
+set network.mesh.netmask=$2
+" | uci batch
+}
+
+mesh_del_ipv4 () {
+ ifconfig br-mesh 0.0.0.0
+ echo "
+delete network.mesh.ipaddr
+delete network.mesh.proto
+delete network.mesh.netmask
+" | uci batch
+}
contact: Jan Huwald // Impressum