View | Details | Raw Unified | Return to bug 413 | Differences between
and this patch

Collapse All | Expand All

(-)channels.c.OLD (-6 / +9 lines)
Lines 2041-2052 Link Here
2041
	 * getaddrinfo returns a loopback address if the hostname is
2041
	 * getaddrinfo returns a loopback address if the hostname is
2042
	 * set to NULL and hints.ai_flags is not AI_PASSIVE
2042
	 * set to NULL and hints.ai_flags is not AI_PASSIVE
2043
	 */
2043
	 */
2044
	if (gateway_ports) {
2044
	/* with new forward shema might option GatewayPorts is useless for the client. */
2045
		if (listen_addr == NULL || listen_addr[0] == '\0' ||
2045
	if ( (type == SSH_CHANNEL_PORT_LISTENER ) ||
2046
		    strcmp(listen_addr, "*") == 0)
2046
	    ((type == SSH_CHANNEL_RPORT_LISTENER) && gateway_ports)) {
2047
			wildcard = 1;
2047
		if (listen_addr != NULL && listen_addr[0] != '\0') {
2048
		else
2048
			if (strcmp(listen_addr, "*") == 0)
2049
			addr = listen_addr;
2049
				wildcard = 1;
2050
			else
2051
				addr = listen_addr;
2052
		}
2050
	}
2053
	}
2051
	memset(&hints, 0, sizeof(hints));
2054
	memset(&hints, 0, sizeof(hints));
2052
	hints.ai_family = IPv4or6;
2055
	hints.ai_family = IPv4or6;
(-)readconf.c.OLD (-1 / +4 lines)
Lines 656-663 Link Here
656
		/* construct a string for parse_forward */
656
		/* construct a string for parse_forward */
657
		size = strlen(arg) + strlen(arg2) + 2;
657
		size = strlen(arg) + strlen(arg2) + 2;
658
		fwdarg = (char *)xmalloc(size);
658
		fwdarg = (char *)xmalloc(size);
659
		*fwdarg = '\0'; /* 'C' does not define allocated memory to be cleaned */
659
		strncat(fwdarg, arg, size);
660
		strncat(fwdarg, arg, size);
660
		strncat(fwdarg, " ", size);
661
		strncat(fwdarg, ":", size);
661
		strncat(fwdarg, arg2, size);
662
		strncat(fwdarg, arg2, size);
662
663
663
		if (parse_forward(&fwd, fwdarg) == 0)
664
		if (parse_forward(&fwd, fwdarg) == 0)
Lines 669-674 Link Here
669
		if (fwd.connect_port == 0)
670
		if (fwd.connect_port == 0)
670
			fatal("%.200s line %d: Bad forwarding port.",
671
			fatal("%.200s line %d: Bad forwarding port.",
671
			    filename, linenum);
672
			    filename, linenum);
673
		xfree(fwdarg);
674
		fwdarg = NULL;
672
675
673
		if (*activep) {
676
		if (*activep) {
674
			if (opcode == oLocalForward)
677
			if (opcode == oLocalForward)
(-)ssh.c.OLD (-2 / +2 lines)
Lines 831-837 Link Here
831
		listen_host = options.local_forwards[i].listen_host;
831
		listen_host = options.local_forwards[i].listen_host;
832
		if (listen_host && listen_host[0] == '\0' && !options.gateway_ports)
832
		if (listen_host && listen_host[0] == '\0' && !options.gateway_ports)
833
			listen_host = NULL;
833
			listen_host = NULL;
834
		debug("Connections to local port %.200s:%d forwarded to remote address %.200s:%d",
834
		debug("Local connections to %.200s:%d forwarded to remote address %.200s:%d",
835
		    listen_host,
835
		    listen_host,
836
		    options.local_forwards[i].listen_port,
836
		    options.local_forwards[i].listen_port,
837
		    options.local_forwards[i].connect_host,
837
		    options.local_forwards[i].connect_host,
Lines 851-857 Link Here
851
		listen_host = options.remote_forwards[i].listen_host;
851
		listen_host = options.remote_forwards[i].listen_host;
852
		if (listen_host && listen_host[0] == '\0' && !options.gateway_ports)
852
		if (listen_host && listen_host[0] == '\0' && !options.gateway_ports)
853
			listen_host = NULL;
853
			listen_host = NULL;
854
		debug("Connections to remote port %.200s:%d forwarded to local address %.200s:%d",
854
		debug("Remote connections from %.200s:%d forwarded to local address %.200s:%d",
855
		    listen_host,
855
		    listen_host,
856
		    options.remote_forwards[i].listen_port,
856
		    options.remote_forwards[i].listen_port,
857
		    options.remote_forwards[i].connect_host,
857
		    options.remote_forwards[i].connect_host,

Return to bug 413