c = channel_lookup(oldch);
if (nc == NULL) { close(newsock); xfree(remote_ipaddr); return; }
channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset){	struct sockaddr addr;	int newsock, newch, oldch;	socklen_t addrlen;	char buf[16384], *remote_ipaddr;	int remote_port;	if (FD_ISSET(c->sock, readset)) {		debug("X11 connection requested.");		addrlen = sizeof(addr);		newsock = accept(c->sock, &addr, &addrlen);		if (newsock < 0) {			error("accept: %.100s", strerror(errno));			return;		}		remote_ipaddr = get_peer_ipaddr(newsock);		remote_port = get_peer_port(newsock);		snprintf(buf, sizeof buf, "X11 connection from %.200s port %d",		    remote_ipaddr, remote_port);		oldch = c->self;		newch = channel_new("x11",		    SSH_CHANNEL_OPENING, newsock, newsock, -1,		    c->local_window_max, c->local_maxpacket,		    0, xstrdup(buf), 1);		c = channel_lookup(oldch);		if (compat20) {			packet_start(SSH2_MSG_CHANNEL_OPEN);			packet_put_cstring("x11");			packet_put_int(newch);			packet_put_int(c->local_window_max);			packet_put_int(c->local_maxpacket);			/* originator ipaddr and port */			packet_put_cstring(remote_ipaddr);			if (datafellows & SSH_BUG_X11FWD) {				debug("ssh2 x11 bug compat mode");			} else {				packet_put_int(remote_port);			}			packet_send();		} else {			packet_start(SSH_SMSG_X11_OPEN);			packet_put_int(newch);			if (have_hostname_in_open)				packet_put_string(buf, strlen(buf));			packet_send();		}		xfree(remote_ipaddr);	}}