add configurable punching delay because of race-condition-y conntracks (#210)
* add configurable punching delay because of race-condition-y conntracks * add changelog * fix tests * only do one punch per query * Coalesce punchy config * It is not is not set * Add tests Co-authored-by: Nate Brown <nbrown.us@gmail.com>
This commit is contained in:
8
main.go
8
main.go
@ -177,8 +177,8 @@ func Main(configPath string, configTest bool, buildVersion string) {
|
||||
go hostMap.Promoter(config.GetInt("promoter.interval"))
|
||||
*/
|
||||
|
||||
punchy := config.GetBool("punchy", false)
|
||||
if punchy == true {
|
||||
punchy := NewPunchyFromConfig(config)
|
||||
if punchy.Punch {
|
||||
l.Info("UDP hole punching enabled")
|
||||
go hostMap.Punchy(udpServer)
|
||||
}
|
||||
@ -193,7 +193,6 @@ func Main(configPath string, configTest bool, buildVersion string) {
|
||||
port = int(uPort.Port)
|
||||
}
|
||||
|
||||
punchBack := config.GetBool("punch_back", false)
|
||||
amLighthouse := config.GetBool("lighthouse.am_lighthouse", false)
|
||||
|
||||
// warn if am_lighthouse is enabled but upstream lighthouses exists
|
||||
@ -222,7 +221,8 @@ func Main(configPath string, configTest bool, buildVersion string) {
|
||||
config.GetInt("lighthouse.interval", 10),
|
||||
port,
|
||||
udpServer,
|
||||
punchBack,
|
||||
punchy.Respond,
|
||||
punchy.Delay,
|
||||
)
|
||||
|
||||
//TODO: Move all of this inside functions in lighthouse.go
|
||||
|
Reference in New Issue
Block a user