mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
portlist: filter out all of 127.0.0.0/8, not just 127.0.0.1/32
Per user private bug report. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
f325aa7e38
commit
e619296ece
@ -42,8 +42,7 @@ func parsePort(s string) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isLoopbackAddr(s string) bool {
|
func isLoopbackAddr(s string) bool {
|
||||||
return strings.HasPrefix(s, "127.0.0.1:") ||
|
return strings.HasPrefix(s, "127.") ||
|
||||||
strings.HasPrefix(s, "127.0.0.1.") ||
|
|
||||||
strings.HasPrefix(s, "[::1]:") ||
|
strings.HasPrefix(s, "[::1]:") ||
|
||||||
strings.HasPrefix(s, "::1.")
|
strings.HasPrefix(s, "::1.")
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ type InOut struct {
|
|||||||
tcp4 0 0 *.8185 *.* LISTEN
|
tcp4 0 0 *.8185 *.* LISTEN
|
||||||
tcp4 0 0 127.0.0.1.8186 *.* LISTEN
|
tcp4 0 0 127.0.0.1.8186 *.* LISTEN
|
||||||
tcp6 0 0 ::1.8187 *.* LISTEN
|
tcp6 0 0 ::1.8187 *.* LISTEN
|
||||||
|
tcp4 0 0 127.1.2.3.8188 *.* LISTEN
|
||||||
|
|
||||||
udp6 0 0 *.5453 *.*
|
udp6 0 0 *.5453 *.*
|
||||||
udp4 0 0 *.5553 *.*
|
udp4 0 0 *.5553 *.*
|
||||||
@ -78,7 +79,7 @@ func TestParsePortsNetstat(t *testing.T) {
|
|||||||
Port{"udp", 5354, "", ""},
|
Port{"udp", 5354, "", ""},
|
||||||
Port{"udp", 5453, "", ""},
|
Port{"udp", 5453, "", ""},
|
||||||
Port{"udp", 5553, "", ""},
|
Port{"udp", 5553, "", ""},
|
||||||
Port{"tcp", 8185, "", ""}, // but not 8186 or 8187 on localhost
|
Port{"tcp", 8185, "", ""}, // but not 8186, 8187, 8188 on localhost
|
||||||
Port{"udp", 9353, "iTunes", ""},
|
Port{"udp", 9353, "iTunes", ""},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user