[PATCH 5/5] nodewatcher: only add direct batman originators

Tim Niemeyer tim.niemeyer at mastersword.de
Di Okt 6 22:44:32 CEST 2015


Am Dienstag, den 06.10.2015, 22:36 +0200 schrieb Tim Niemeyer:
> Signed-off-by: Tim Niemeyer <tim.niemeyer at mastersword.de>
> ---
> 
>  bsp/default/root_file_system/etc/nodewatcher.sh | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/bsp/default/root_file_system/etc/nodewatcher.sh b/bsp/default/root_file_system/etc/nodewatcher.sh
> index de2c783..4081b33 100755
> --- a/bsp/default/root_file_system/etc/nodewatcher.sh
> +++ b/bsp/default/root_file_system/etc/nodewatcher.sh
> @@ -174,8 +174,12 @@ crawl() {
>                  sub("\\[", "", $0)
>                  sub("\\]:", "", $0)
>                  sub("  ", " ", $0)
> -                printf "<originator_"i"><originator>"$1"</originator><link_quality>"$3"</link_quality><nexthop>"$4"</nexthop><last_seen>"$2"</last_seen><outgoing_interface>"$5"</outgoing_interface></originator_"i">"
> -                i++
> +                o=$1".*"$1
> +                if ($0 ~ o)
> +                {
> +                    printf "<originator_"i"><originator>"$1"</originator><link_quality>"$3"</link_quality><nexthop>"$4"</nexthop><last_seen>"$2"</last_seen><outgoing_interface>"$5"</outgoing_interface></originator_"i">"

Hier muss ggfs noch etwas Arbeit rein. Eigentlich wäre nexthop hier
nämlich nicht mehr nötig. (wir brauchen ja nur die nexthop originators)
Aber wir zeigen immer die Linkquality vom nexthop an, auch wenn der
nexthop nicht der originator ist. :(

Meinungen?

Tim
> +                    i++
> +                }
>              }' /sys/kernel/debug/batman_adv/bat0/originators)
>          
>  		batman_adv_gateway_mode=$(batctl gw)





Mehr Informationen über die Mailingliste franken-dev