File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -729,16 +729,19 @@ func isPrivateIP(config Config, addr multiaddr.Multiaddr) bool {
729729 // IPv6
730730 {IP : net .ParseIP ("fc00::" ), Mask : net .CIDRMask (7 , 128 )}, // Unique local address
731731 {IP : net .ParseIP ("fe80::" ), Mask : net .CIDRMask (10 , 128 )}, // Link-local unicast
732- {IP : net .IPv6loopback , Mask : net .CIDRMask (128 , 128 )}, // Loopback }
733732 }
734-
735- // Check if the IP falls into any of the private ranges
733+
734+ // Check if the IP falls into any of the private ranges or is loopback (::1)
736735 for _ , r := range privateRanges {
737736 if r .Contains (ip ) {
738737 config .Logger .Infof ("Found private IP: %s" , ip )
739738 return true
740739 }
741740 }
741+ if ip .Equal (net .IPv6loopback ) { // ::1
742+ config .Logger .Infof ("Found IPv6 loopback: %s" , ip )
743+ return true
744+ }
742745 return false
743746}
744747
You can’t perform that action at this time.
0 commit comments