← Back to team overview

linuxdcpp-team team mailing list archive

[Bug 1106226] Re: Crash when connecting via IPv6

 

can you try this patch? it shouldn't crash but it will also disallow
clients with invalid IPs; it writes a message to the console when it
does so, please report them here to see what went wrong.

=== modified file 'adchpp/ClientManager.cpp'
--- adchpp/ClientManager.cpp	2013-01-18 21:41:53 +0000
+++ adchpp/ClientManager.cpp	2013-01-30 15:52:05 +0000
@@ -339,8 +339,14 @@
 		return true;
 
 	using namespace boost::asio::ip;
-
-	auto remote = address::from_string(c.getIp());
+	address remote;
+
+	try { remote = address::from_string(c.getIp(), ec); }
+	catch(const boost::system::system_error&) {
+		printf("Error when reading IP %s\n", c.getIp().c_str());
+		return false;
+	}
+
 	std::string ip;
 
 	if(remote.is_v4() || (remote.is_v6() && remote.to_v6().is_v4_mapped())) {

-- 
You received this bug notification because you are a member of
Dcplusplus-team, which is subscribed to ADCH++.
https://bugs.launchpad.net/bugs/1106226

Title:
  Crash when connecting via IPv6

Status in ADCH++:
  New

Bug description:
  My LAN ADCH++ hub crashes when connecting via LAN IPv6 address. R628
  x64 release running on Debian Wheezy. Happens with ADC and ADCS both.

  http://pastebin.com/kMJcrAHA

To manage notifications about this bug go to:
https://bugs.launchpad.net/adchpp/+bug/1106226/+subscriptions


References