ipv6 privacy extensions
This commit is contained in:
parent
ab8c64bab8
commit
c92dd8f0b0
2
tinc-down
Normal file → Executable file
2
tinc-down
Normal file → Executable file
@ -8,7 +8,7 @@ stop_dhclient() {
|
||||
local pid_file="/var/run/dhclient.${interface}.pid"
|
||||
if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
||||
dhclient -r -x
|
||||
elif [[ -f "$pid_file" ]
|
||||
elif [[ -f "$pid_file" ]]; then
|
||||
kill "$(< $pid_file)"
|
||||
fi
|
||||
}
|
||||
|
16
tinc-up
16
tinc-up
@ -89,6 +89,17 @@ start_dhcp() {
|
||||
fi
|
||||
}
|
||||
|
||||
disable_ipv6_privacy() {
|
||||
local interface=$1
|
||||
if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
||||
sysctl -w "net.ipv6.conf.${interface}.use_tempaddr=0"
|
||||
elif [[ "$OSTYPE" == "openbsd"* ]]; then
|
||||
ifconfig "${interface}" -autoconfprivacy
|
||||
elif has sysctl; then
|
||||
sysctl -w net.inet6.ip6.use_tempaddr=0
|
||||
fi
|
||||
}
|
||||
|
||||
[ -z "${INTERFACE:-}" ] && die "no INTERFACE environment variable set"
|
||||
|
||||
DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
|
||||
@ -113,4 +124,7 @@ if [ -e $SUBNET_FILE ]; then
|
||||
else
|
||||
start_dhcp "$INTERFACE"
|
||||
fi
|
||||
[ -x "$LOCAL_HOOK_FILE" ] && "$LOCAL_HOOK_FILE"
|
||||
|
||||
disable_ipv6_privacy "$INTERFACE"
|
||||
|
||||
[ -x "$LOCAL_HOOK_FILE" ] && "$LOCAL_HOOK_FILE" || true
|
||||
|
Loading…
Reference in New Issue
Block a user