Skip to content

Commit

Permalink
shared-state look for neighbours also on br-lan
Browse files Browse the repository at this point in the history
Because br-lan may contain unreal neighbours interfaces such as bat0
  accept only the ones which answhere in less then 2ms
  • Loading branch information
G10h4ck committed Mar 1, 2019
1 parent ed81102 commit 79ab7cb
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -30,6 +30,10 @@ for iface in $(ls /sys/class/net/) ; do
awk '{if ($3 == "from") print substr($4, 1, length($4)-1)'"\"%$iface\""'}'
done | sort -u -r)"

candidateAddresses="$candidateAddresses
$(ping6 -c 2 ff02::1%br-lan | \
awk '{if ($3 == "from" && substr($7,6)+0 < 2) print substr($4, 1, length($4)-1)"%br-lan" }' | sort -u)"

for ownAddr in $(ip -6 address show | awk '{if ($1 == "inet6") print $2}' | awk -F/ '{print $1}') ; do
candidateAddresses="$(echo "$candidateAddresses" | grep -v "$ownAddr")"
done
Expand Down

0 comments on commit 79ab7cb

Please sign in to comment.