From 55ab6c4b4a6d8850292bb31f27c135686c689166 Mon Sep 17 00:00:00 2001 From: Simon Martin Date: Mon, 14 Apr 2025 14:45:01 +0000 Subject: [PATCH] config: add missing private ip ranges I noticed that 172.16.0.0/12 is missing from the default private IP address space; following a quick discussion in [1], this patches adds it, as well as link local ranges. [1] https://lists.sr.ht/~sircmpwn/sr.ht-dev/%3C20241218140750.2393901-1-robin@jarry.cc%3E Fixes: deb699c9d01a ("add global internal-ipnet setting") Signed-off-by: Simon Martin --- config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index ee8afab92bd28bc788b7e4fce1ceede362be5d1b..9f1517c3485154f5c106a2f9f788301d234d049a 100644 --- a/config/config.go +++ b/config/config.go @@ -85,7 +85,9 @@ func LoadConfig(defaultAddr string) ini.File { nets, ok := config.Get("sr.ht", "internal-ipnet") if !ok { - nets = "127.0.0.0/8,192.168.0.0/16,10.0.0.0/8,::1/128,fc00::/7" + nets = "127.0.0.0/8,::1/128," + // Loopback + "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7," + // Private + "169.254.0.0/16,fe80::/64" // Link local } for _, n := range strings.Split(nets, ",") { _, net, err := net.ParseCIDR(n)