Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

Commit

Permalink
catch some domains that resolve to 0.0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
erkexzcx committed Mar 3, 2022
1 parent c8ae175 commit 1053c25
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/stoppropaganda/websites.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ func runWebsiteWorker(c chan *Website) {
continue
}

if containsPrivateIP(ipAddresses) {
if containsNonPublicIP(ipAddresses) {
website.mux.Lock()
website.Status = "Private IP detected"
website.Status = "Non public IP detected"
website.paused = true
website.mux.Unlock()

Expand Down Expand Up @@ -503,9 +503,9 @@ func getIPs(host string) (ips []net.IP, err error) {
return ipAddresses, nil
}

func containsPrivateIP(ips []net.IP) bool {
func containsNonPublicIP(ips []net.IP) bool {
for _, ip := range ips {
if ip.IsPrivate() || ip.IsLoopback() {
if ip.IsPrivate() || ip.IsLoopback() || ip.IsUnspecified() {
return true
}
}
Expand Down

0 comments on commit 1053c25

Please sign in to comment.