mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	allow ipv6 adresses for UDP server tunnels
This commit is contained in:
		
							parent
							
								
									ba369d9b30
								
							
						
					
					
						commit
						d124d4cace
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		| 
						 | 
					@ -720,9 +720,15 @@ namespace client
 | 
				
			||||||
					{
 | 
										{
 | 
				
			||||||
						// udp server tunnel
 | 
											// udp server tunnel
 | 
				
			||||||
						// TODO: hostnames
 | 
											// TODO: hostnames
 | 
				
			||||||
						if (address.empty ()) address = "127.0.0.1";
 | 
					 | 
				
			||||||
						auto localAddress = boost::asio::ip::address::from_string(address);
 | 
					 | 
				
			||||||
						boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(host), port);
 | 
											boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(host), port);
 | 
				
			||||||
 | 
											if (address.empty ())
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												if (!endpoint.address ().is_unspecified () && endpoint.address ().is_v6 ())
 | 
				
			||||||
 | 
													address = "::1";
 | 
				
			||||||
 | 
												else
 | 
				
			||||||
 | 
													address = "127.0.0.1";
 | 
				
			||||||
 | 
											}	
 | 
				
			||||||
 | 
											auto localAddress = boost::asio::ip::address::from_string(address);	
 | 
				
			||||||
						auto serverTunnel = std::make_shared<I2PUDPServerTunnel>(name, localDestination, localAddress, endpoint, port, gzip);
 | 
											auto serverTunnel = std::make_shared<I2PUDPServerTunnel>(name, localDestination, localAddress, endpoint, port, gzip);
 | 
				
			||||||
						if(!isUniqueLocal)
 | 
											if(!isUniqueLocal)
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue