rem: he=sip_resolvehost(name, &port);
add: he=sip_resolvehost(name, &port, via->proto);
context: int update_sock_struct_from_via( union sockaddr_union* to,								 struct via_body* via ){	struct hostent* he;	str* name;	int err;	unsigned short port;	port=0;	if (via->rport && via->rport->value.s){		port=str2s(via->rport->value.s, via->rport->value.len, &err);		if (err){			LOG(L_NOTICE, "ERROR: forward_reply: bad rport value(%.*s)\n",					via->rport->value.len, via->rport->value.s);			port=0;		}	}	if (via->received){		DBG("update_sock_struct_from_via: using 'received'\n");		name=&(via->received->value);		/* making sure that we won't do SRV lookup on "received"		 * (possible if no DNS_IP_HACK is used)*/		if (port==0) port=via->port?via->port:SIP_PORT; 	}else{		DBG("update_sock_struct_from_via: using via host\n");		name=&(via->host);		if (port==0) port=via->port;	}	/* we do now a malloc/memcpy because gethostbyname loves \0-terminated 	   strings; -jiri 	   but only if host is not null terminated	   (host.s[len] will always be ok for a via)	    BTW: when is via->host.s non null terminated? tm copy? - andrei 	    Yes -- it happened on generating a 408 by TM; -jiri	    sip_resolvehost now accepts str -janakj	*/	DBG("update_sock_struct_from_via: trying SRV lookup\n");	he=sip_resolvehost(name, &port);		if (he==0){		LOG(L_NOTICE, "ERROR:forward_reply:resolve_host(%.*s) failure\n",				name->len, name->s);		return -1;	}			hostent2su(to, he, 0, htons(port));	return 1;}