mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	Enable CKR properly from config
This commit is contained in:
		
							parent
							
								
									bc578f571c
								
							
						
					
					
						commit
						bc62af7f7d
					
				
					 2 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -37,6 +37,10 @@ func (c *cryptokey) init(core *Core) {
 | 
			
		|||
	c.ipv6sources = make([]net.IPNet, 0)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *cryptokey) setEnabled(enabled bool) {
 | 
			
		||||
	c.enabled = enabled
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *cryptokey) isEnabled() bool {
 | 
			
		||||
	return c.enabled
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -121,7 +121,8 @@ func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) error {
 | 
			
		|||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if nc.TunnelRouting.Enable {
 | 
			
		||||
	c.router.cryptokey.setEnabled(nc.TunnelRouting.Enable)
 | 
			
		||||
	if c.router.cryptokey.isEnabled() {
 | 
			
		||||
		c.log.Println("Crypto-key routing enabled")
 | 
			
		||||
		for ipv6, pubkey := range nc.TunnelRouting.IPv6Destinations {
 | 
			
		||||
			if err := c.router.cryptokey.addRoute(ipv6, pubkey); err != nil {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue