shithub: riscv

Download patch

ref: 7f5f69ebb5c1fa361d44dc33465be79991dd0d94
parent: 7a54873252a6e8a55dd296ee155469e6ffbdd475
author: cinap_lenrek <[email protected]>
date: Fri Dec 26 06:41:53 EST 2014

socksd: revert back, previous commit broke UdpAssociate request

should probably figure out a better way to get public ip
address on a interface.

--- a/sys/src/cmd/ip/socksd.c
+++ b/sys/src/cmd/ip/socksd.c
@@ -299,11 +299,15 @@
 		alarm(0);
 		break;
 	case 0x02:	/* BIND */
-		snprint(addr, sizeof(addr), "%s/tcp!*!0", outside);
+		if(myipaddr(buf, outside) < 0)
+			break;
+		snprint(addr, sizeof(addr), "%s/tcp!%I!0", outside, buf);
 		fd = announce(addr, dir);
 		break;
 	case 0x03:	/* UDP */
-		snprint(addr, sizeof(addr), "%s/udp!*!0", inside);
+		if(myipaddr(buf, inside) < 0)
+			break;
+		snprint(addr, sizeof(addr), "%s/udp!%I!0", inside, buf);
 		fd = announce(addr, dir);
 		break;
 	}