c = channel_lookup(oldch); nc = channel_lookup(newch);
channel_post_port_listener(Channel *c, fd_set * readset, fd_set * writeset){	Channel *nc;	struct sockaddr addr;	int newsock, newch, nextstate, oldch;	socklen_t addrlen;	char *rtype;	if (FD_ISSET(c->sock, readset)) {		debug("Connection to port %d forwarding "		    "to %.100s port %d requested.",		    c->listening_port, c->path, c->host_port);		rtype = (c->type == SSH_CHANNEL_RPORT_LISTENER) ?		    "forwarded-tcpip" : "direct-tcpip";		nextstate = (c->host_port == 0) ? SSH_CHANNEL_DYNAMIC :		    SSH_CHANNEL_OPENING;		addrlen = sizeof(addr);		newsock = accept(c->sock, &addr, &addrlen);		if (newsock < 0) {			error("accept: %.100s", strerror(errno));			return;		}		oldch = c->self;		newch = channel_new(rtype,		    nextstate, newsock, newsock, -1,		    c->local_window_max, c->local_maxpacket,		    0, xstrdup(rtype), 1);		c = channel_lookup(oldch);		nc = channel_lookup(newch);		if (nc == NULL) {			error("xxx: no new channel:");			return;		}		nc->listening_port = c->listening_port;		nc->host_port = c->host_port;		strlcpy(nc->path, c->path, sizeof(nc->path));		if (nextstate != SSH_CHANNEL_DYNAMIC)			port_open_helper(nc, rtype);	}}