Repository : ssh://git@open-mesh.org/openwrt-feed-devel
On branch : master
commit 3317b1e28607a4e2ca80d9ef340e1461567e1072 Author: Adrian Schmutzler freifunk@adrianschmutzler.de Date: Mon Mar 19 14:16:54 2018 +0100
alfred-devel: Support interface IDs with more than two digits
Occationally /proc/net/if_inet6 contains interface IDs with three digits. In this case, the regex in wait_for_ll_address() does not work anymore and alfred is not starting.
This patch changes the evaluation so that fields are used instead of the mere position by counting characters.
Signed-off-by: Adrian Schmutzler freifunk@adrianschmutzler.de Signed-off-by: Sven Eckelmann sven@narfation.org
3317b1e28607a4e2ca80d9ef340e1461567e1072 alfred-devel/files/alfred.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/alfred-devel/files/alfred.init b/alfred-devel/files/alfred.init index 4c9a9e1..8293436 100755 --- a/alfred-devel/files/alfred.init +++ b/alfred-devel/files/alfred.init @@ -46,11 +46,11 @@ wait_for_ll_address() for i in $(seq $timeout); do # We look for # - the link-local address (starts with fe80) - # - without tentative flag (bit 0x40 in the flags field; the first char of the flags field begins 38 columns after the fe80 prefix + # - without tentative flag (bit 0x40 in the flags field; the first char of the fifth field is evaluated) # - on interface $iface if awk ' BEGIN { RET=1 } - /^fe80.{37} [012389ab]/ { if ($6 == "'"$iface"'") RET=0 } + $1 ~ /^fe80/ && $5 ~ /^[012389ab]/ && $6 == "'"$iface"'" { RET=0 } END { exit RET } ' /proc/net/if_inet6; then return