wg-quick: anchor sysctl regex to start and end

This doesn't actually fix a real problem, but it is more correct than
not having it.

Suggested-by: Aaron Sigel <aaron@vtty.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2017-10-01 21:37:53 +02:00
parent 5b65f87e9f
commit a566bde126

View file

@ -163,7 +163,7 @@ add_default() {
local key value
while read -r key _ value; do
[[ $value -eq 1 ]] && sysctl -q "$key=2"
done < <(sysctl -a -r 'net\.ipv4.conf\..+\.rp_filter')
done < <(sysctl -a -r '^net\.ipv4.conf\.[^ .=]+\.rp_filter$')
return 0
}