mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	Fix passing CIDR to tun.setup
This commit is contained in:
		
							parent
							
								
									ef2ed4b04a
								
							
						
					
					
						commit
						12cba9dac9
					
				
					 2 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -125,7 +125,8 @@ func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) error {
 | 
			
		|||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err := c.tun.setup(nc.IfName, nc.IfTAPMode, net.IP(c.router.addr[:]).String(), nc.IfMTU); err != nil {
 | 
			
		||||
	ip := net.IP(c.router.addr[:]).String()
 | 
			
		||||
	if err := c.tun.setup(nc.IfName, nc.IfTAPMode, fmt.Sprintf("%s/8", ip), nc.IfMTU); err != nil {
 | 
			
		||||
		c.log.Println("Failed to start TUN/TAP")
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -212,7 +212,7 @@ func main() {
 | 
			
		|||
	// start Yggdrasil. This will start the router, switch, DHT node, TCP and UDP
 | 
			
		||||
	// sockets, TUN/TAP adapter and multicast discovery port.
 | 
			
		||||
	if err := n.core.Start(cfg, logger); err != nil {
 | 
			
		||||
		logger.Println("An error occured during startup")
 | 
			
		||||
		logger.Println("An error occurred during startup")
 | 
			
		||||
		panic(err)
 | 
			
		||||
	}
 | 
			
		||||
	// If any static peers were provided in the configuration above then we should
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue