forked from freifunk-franken/firmware
fff-babeld: Simplify CIDR mask removal
The removal of CIDR masks from ip addresses is changed to utilize variable substitutions, which simplifies the expression. Signed-off-by: Fabian Bläse <fabian@blaese.de> Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
This commit is contained in:
parent
8ef6dba5a1
commit
51ec3648cf
|
@ -49,7 +49,7 @@ babel_add_peeraddr() {
|
|||
uci add_list "$option"="$ip"
|
||||
elif ipaddr=$(uci -q get gateway.@client[0].ipaddr); then
|
||||
# use client interface address (without subnet) if no router_ip is set
|
||||
uci add_list "$option"=$(echo $ipaddr | cut -d / -f1)
|
||||
uci add_list "$option"=${ipaddr%%/*}
|
||||
else
|
||||
echo "WARNING: No peer_ip, router_ip or client interface ipaddr set! IPv4 routing is not possible."
|
||||
return 1
|
||||
|
|
Loading…
Reference in New Issue