-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix subnet protection for non-full network states (eg. limited, etc.) (…
- Loading branch information
Showing
6 changed files
with
73 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/command/execlineb -S0 | ||
|
||
ifelse | ||
{ | ||
importas -D 0 S6_KEEP_ENV S6_KEEP_ENV | ||
eltest 0${S6_KEEP_ENV} -eq 0 | ||
} | ||
{ | ||
s6-envdir -Lfn -- /run/s6/container_environment | ||
exec | ||
$@ | ||
} | ||
|
||
$@ |
14 changes: 0 additions & 14 deletions
14
tailscale/rootfs/etc/NetworkManager/dispatcher.d/connectivity-change
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
tailscale/rootfs/etc/NetworkManager/dispatcher.d/protect-subnets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/command/with-contenv-merge bashio | ||
# shellcheck shell=bash | ||
# The shebang 'with-contenv-merge' above is identical with 'with-contenv', but doesn't clear the current environment containing the dispatcher variables | ||
|
||
case "${NM_DISPATCHER_ACTION}" in | ||
up|down|dhcp4-change|dhcp6-change) | ||
bashio::log.info "Handling Network Manager action ${DEVICE_IP_IFACE-} ${NM_DISPATCHER_ACTION}" | ||
unprotect-subnet-routes | ||
if ! protect-subnet-routes; then | ||
# Better stop add-on than risking losing all network connections | ||
bashio::log.error "Failed to protect subnet routes. Halting add-on to prevent network loss." | ||
echo -n 1 > /run/s6-linux-init-container-results/exitcode | ||
exec /run/s6/basedir/bin/halt | ||
fi | ||
;; | ||
connectivity-change) | ||
bashio::log.debug "Unhandled Network Manager action ${NM_DISPATCHER_ACTION} ${CONNECTIVITY_STATE-}" | ||
;; | ||
*) | ||
bashio::log.debug "Unhandled Network Manager action ${DEVICE_IP_IFACE-} ${NM_DISPATCHER_ACTION}" | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters