mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-17 02:47:51 +01:00
New flag Firewall in the Features field to inform uncontacted peers that a Traverse message might be required to establish a connection. Close #61
This flag can be activated via the config setting LocalFirewall. The Features field exists in Announcement/Response messages and was now added to peer records.
This commit is contained in:
@@ -32,6 +32,9 @@ type Networks struct {
|
||||
|
||||
// ipListen keeps a simple list of IPs listened to. This allows quickly identifying if an IP matches with a listened one.
|
||||
ipListen *ipList
|
||||
|
||||
// localFirewall indicates if a local firewall may drop unsolicited incoming packets
|
||||
localFirewall bool
|
||||
}
|
||||
|
||||
// ReplyTimeout is the round-trip timeout for message sequences.
|
||||
@@ -47,4 +50,10 @@ func initMessageSequence() {
|
||||
networks.Sequences = protocol.NewSequenceManager(ReplyTimeout)
|
||||
|
||||
networks.ipListen = NewIPList()
|
||||
|
||||
// There is currently no suitable live firewall detection code. Instead, there is the config flag.
|
||||
// Windows: If the user runs as non-admin, it can be assumed that the Windows Firewall creates a rule to drop unsolicited incoming packets.
|
||||
// Changing the Windows Firewall (via netsh or otherwise) requires elevated admin rights.
|
||||
// This flag will be passed on to other peers to indicate that uncontacted peers shall use the Traverse message for establishing connections.
|
||||
networks.localFirewall = config.LocalFirewall
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user