Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change phantom_blocklist behavior #75

Merged
merged 2 commits into from
Mar 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions application/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ func get_zmq_updates(connectAddr string, regManager *cj.RegistrationManager, con
go tryShareRegistrationOverAPI(reg, conf.PreshareEndpoint)
}


if conf.IsBlocklistedPhantom(reg.DarkDecoy) {
// Note: Phantom blocklist is applied at this stage because the phantom may only be blocked on this
// station. We may want other stations to be informed about the registration, but prevent this station
// specifically from handling / interfering in any subsequent connection. See PR #75
logger.Printf("ignoring registration with blocklisted phantom: %s %v", reg.IDString(), reg.DarkDecoy)
continue
}

// validate the registration
regManager.AddRegistration(reg)
logger.Printf("Adding registration %v\n", reg.IDString())
Expand Down Expand Up @@ -328,14 +337,9 @@ func recieve_zmq_message(sub *zmq.Socket, regManager *cj.RegistrationManager, co
logger.Printf("Failed to create registration: %v", err)
return nil, err
}
if conf.IsBlocklistedPhantom(reg.DarkDecoy) {
logger.Printf("ignoring registration with blocklisted phantom: %s %v", reg.IDString(), reg.DarkDecoy)

} else {
// Received new registration, parse it and return
newRegs = append(newRegs, reg)
}

// Received new registration, parse it and return
newRegs = append(newRegs, reg)
}

if parsed.GetRegistrationPayload().GetV6Support() && conf.EnableIPv6 {
Expand All @@ -344,12 +348,8 @@ func recieve_zmq_message(sub *zmq.Socket, regManager *cj.RegistrationManager, co
logger.Printf("Failed to create registration: %v", err)
return nil, err
}
if conf.IsBlocklistedPhantom(reg.DarkDecoy) {
logger.Printf("ignoring registration with blocklisted phantom: %s %v", reg.IDString(), reg.DarkDecoy)
} else {
// add to list of new registrations to be processed.
newRegs = append(newRegs, reg)
}
// add to list of new registrations to be processed.
newRegs = append(newRegs, reg)
}

// log decoy connection and id string
Expand Down