diff --git a/briar-core/src/org/briarproject/plugins/tcp/LanTcpPlugin.java b/briar-core/src/org/briarproject/plugins/tcp/LanTcpPlugin.java
index d67a6d22e2115ac19e6d60323380d6a3a89cd314..d4d3c506246aa67e55fdc6f237d504bbe1b952e4 100644
--- a/briar-core/src/org/briarproject/plugins/tcp/LanTcpPlugin.java
+++ b/briar-core/src/org/briarproject/plugins/tcp/LanTcpPlugin.java
@@ -1,18 +1,12 @@
 package org.briarproject.plugins.tcp;
 
-import static java.util.logging.Level.WARNING;
-
 import java.net.Inet4Address;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
-import java.net.NetworkInterface;
 import java.net.SocketAddress;
-import java.net.SocketException;
-import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.Executor;
-import java.util.logging.Logger;
 
 import org.briarproject.api.TransportId;
 import org.briarproject.api.TransportProperties;
@@ -22,9 +16,6 @@ class LanTcpPlugin extends TcpPlugin {
 
 	static final TransportId ID = new TransportId("lan");
 
-	private static final Logger LOG =
-			Logger.getLogger(LanTcpPlugin.class.getName());
-
 	LanTcpPlugin(Executor pluginExecutor, DuplexPluginCallback callback,
 			int maxFrameLength, long maxLatency, long pollingInterval) {
 		super(pluginExecutor, callback, maxFrameLength, maxLatency,
@@ -39,25 +30,15 @@ class LanTcpPlugin extends TcpPlugin {
 	protected List<SocketAddress> getLocalSocketAddresses() {
 		// Use the same address and port as last time if available
 		TransportProperties p = callback.getLocalProperties();
-		InetSocketAddress old = parseSocketAddress(p.get("address"),
-				p.get("port"));
-		// Get a list of the device's network interfaces
-		List<NetworkInterface> ifaces;
-		try {
-			ifaces = Collections.list(NetworkInterface.getNetworkInterfaces());
-		} catch(SocketException e) {
-			if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
-			return Collections.emptyList();
-		}
+		String oldAddress = p.get("address"), oldPort = p.get("port");
+		InetSocketAddress old = parseSocketAddress(oldAddress, oldPort);
 		List<SocketAddress> addrs = new LinkedList<SocketAddress>();
-		for(NetworkInterface iface : ifaces) {
-			for(InetAddress a : Collections.list(iface.getInetAddresses())) {
-				if(isAcceptableAddress(a)) {
-					// If this is the old address, try to use the same port
-					if(old != null && old.getAddress().equals(a))
-						addrs.add(0, new InetSocketAddress(a, old.getPort()));
-					addrs.add(new InetSocketAddress(a, 0));
-				}
+		for(InetAddress a : getLocalIpAddresses()) {
+			if(isAcceptableAddress(a)) {
+				// If this is the old address, try to use the same port
+				if(old != null && old.getAddress().equals(a))
+					addrs.add(0, new InetSocketAddress(a, old.getPort()));
+				addrs.add(new InetSocketAddress(a, 0));
 			}
 		}
 		return addrs;
@@ -77,7 +58,7 @@ class LanTcpPlugin extends TcpPlugin {
 		if(remote.getPort() == 0) return false;
 		if(!isAcceptableAddress(remote.getAddress())) return false;
 		// Try to determine whether the address is on the same LAN as us
-		if(socket == null) return true;
+		if(socket == null) return false;
 		byte[] localIp = socket.getInetAddress().getAddress();
 		byte[] remoteIp = remote.getAddress().getAddress();
 		return addressesAreOnSameLan(localIp, remoteIp);
diff --git a/briar-core/src/org/briarproject/plugins/tcp/TcpPlugin.java b/briar-core/src/org/briarproject/plugins/tcp/TcpPlugin.java
index 827a5098868b6ab8bed17f6e4cb89f2dce209d79..673828b438d1e7f3fbe4969040979c6ed21ccb5d 100644
--- a/briar-core/src/org/briarproject/plugins/tcp/TcpPlugin.java
+++ b/briar-core/src/org/briarproject/plugins/tcp/TcpPlugin.java
@@ -6,11 +6,15 @@ import static java.util.logging.Level.WARNING;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.net.NetworkInterface;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.net.SocketAddress;
+import java.net.SocketException;
 import java.net.UnknownHostException;
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.Executor;
 import java.util.logging.Logger;
@@ -182,7 +186,10 @@ abstract class TcpPlugin implements DuplexPlugin {
 		InetSocketAddress remote = getRemoteSocketAddress(c);
 		if(remote == null) return null;
 		if(!isConnectable(remote)) {
-			if(LOG.isLoggable(INFO)) LOG.info(remote + " is not connectable");
+			if(LOG.isLoggable(INFO)) {
+				SocketAddress local = socket.getLocalSocketAddress();
+				LOG.info(remote + " is not connectable from " + local);
+			}
 			return null;
 		}
 		Socket s = new Socket();
@@ -229,4 +236,18 @@ abstract class TcpPlugin implements DuplexPlugin {
 			long timeout) {
 		throw new UnsupportedOperationException();
 	}
+
+	protected Collection<InetAddress> getLocalIpAddresses() {
+		List<NetworkInterface> ifaces;
+		try {
+			ifaces = Collections.list(NetworkInterface.getNetworkInterfaces());
+		} catch(SocketException e) {
+			if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
+			return Collections.emptyList();
+		}
+		List<InetAddress> addrs = new ArrayList<InetAddress>();
+		for(NetworkInterface iface : ifaces)
+			addrs.addAll(Collections.list(iface.getInetAddresses()));
+		return addrs;
+	}
 }
diff --git a/briar-core/src/org/briarproject/plugins/tcp/WanTcpPlugin.java b/briar-core/src/org/briarproject/plugins/tcp/WanTcpPlugin.java
index 16c168c2e487c2e136a631dd20d58069da4fd7aa..7a403b63682d1862200076eda88d8e2804c6151f 100644
--- a/briar-core/src/org/briarproject/plugins/tcp/WanTcpPlugin.java
+++ b/briar-core/src/org/briarproject/plugins/tcp/WanTcpPlugin.java
@@ -1,18 +1,12 @@
 package org.briarproject.plugins.tcp;
 
-import static java.util.logging.Level.WARNING;
-
 import java.net.Inet4Address;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
-import java.net.NetworkInterface;
 import java.net.SocketAddress;
-import java.net.SocketException;
-import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.Executor;
-import java.util.logging.Logger;
 
 import org.briarproject.api.TransportId;
 import org.briarproject.api.TransportProperties;
@@ -22,9 +16,6 @@ class WanTcpPlugin extends TcpPlugin {
 
 	static final TransportId ID = new TransportId("wan");
 
-	private static final Logger LOG =
-			Logger.getLogger(WanTcpPlugin.class.getName());
-
 	private final PortMapper portMapper;
 
 	private volatile MappingResult mappingResult;
@@ -45,25 +36,15 @@ class WanTcpPlugin extends TcpPlugin {
 	protected List<SocketAddress> getLocalSocketAddresses() {
 		// Use the same address and port as last time if available
 		TransportProperties p = callback.getLocalProperties();
-		InetSocketAddress old = parseSocketAddress(p.get("address"),
-				p.get("port"));
-		// Get a list of the device's network interfaces
-		List<NetworkInterface> ifaces;
-		try {
-			ifaces = Collections.list(NetworkInterface.getNetworkInterfaces());
-		} catch(SocketException e) {
-			if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
-			return Collections.emptyList();
-		}
+		String oldAddress = p.get("address"), oldPort = p.get("port");
+		InetSocketAddress old = parseSocketAddress(oldAddress, oldPort);
 		List<SocketAddress> addrs = new LinkedList<SocketAddress>();
-		for(NetworkInterface iface : ifaces) {
-			for(InetAddress a : Collections.list(iface.getInetAddresses())) {
-				if(isAcceptableAddress(a)) {
-					// If this is the old address, try to use the same port
-					if(old != null && old.getAddress().equals(a))
-						addrs.add(0, new InetSocketAddress(a, old.getPort()));
-					addrs.add(new InetSocketAddress(a, 0));
-				}
+		for(InetAddress a : getLocalIpAddresses()) {
+			if(isAcceptableAddress(a)) {
+				// If this is the old address, try to use the same port
+				if(old != null && old.getAddress().equals(a))
+					addrs.add(0, new InetSocketAddress(a, old.getPort()));
+				addrs.add(new InetSocketAddress(a, 0));
 			}
 		}
 		// Accept interfaces with local addresses that can be port-mapped