Skip to content

Commit

Permalink
👕 Skip address family from route advertisement if it has forwarding d…
Browse files Browse the repository at this point in the history
…isabled (#19)
  • Loading branch information
frenck authored Aug 24, 2021
1 parent d087d41 commit 112231c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tailscale/rootfs/etc/services.d/tailscaled/post
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ for address in "${addresses[@]}"; do
then
continue
fi


# Skip if forwarding for the address family is disabled
if [[ "${address}" =~ .*:.* ]];
then
[[ $(</proc/sys/net/ipv6/conf/all/forwarding) -eq 0 ]] && continue
else
[[ $(</proc/sys/net/ipv4/ip_forward) -eq 0 ]] && continue
fi

ipinfo="$(/usr/bin/ipcalc --json "${address}")"
routes+=($(bashio::jq "${ipinfo}" '.NETWORK + "/" + .PREFIX'))
fi
Expand Down

0 comments on commit 112231c

Please sign in to comment.