rem: if (udp_send(new_buf,new_len, &to, sizeof(to))==-1)
add: if (udp_send(new_buf,new_len, &to, sizeof(struct sockaddr))==-1)
context: int forward_reply(char * orig, char* buf, 					 unsigned int len,					 struct sip_msg* msg){	unsigned int new_len, via_len,r;	char* new_buf;	int offset, s_offset, size;	struct hostent* he;	struct sockaddr_in* to;	new_buf=0;	to=0;	to=(struct sockaddr_in*)malloc(sizeof(struct sockaddr));	if (to==0){		DPrint("ERROR: forward_reply: out of memory\n");		goto error;	}	/*check if first via host = us */	if (check_via){		for (r=0; r<addresses_no; r++)			if(strcmp(msg->via1.host, names[r])==0) break;		if (r==addresses_no){			DPrint("ERROR: forward_reply: host in first via != me : %s\n",					msg->via1.host);			/* send error msg back? */			goto error;		}	}	/* we must remove the first via */	via_len=msg->via1.size;	size=msg->via1.hdr-buf;	if (msg->via1.next){		/* keep hdr =substract hdr size +1 (hdr':') and add		 */		via_len-=strlen(msg->via1.hdr)+1;		size+=strlen(msg->via1.hdr)+1;	}	new_len=len-size;	new_buf=(char*)malloc(new_len);	if (new_buf==0){		DPrint("ERROR: forward_reply: out of memory\n");		goto error;	}	memcpy(new_buf, orig, size);	offset=size;	s_offset=size+via_len;	memcpy(new_buf+offset,orig+s_offset, len-s_offset);	 /* send it! */	printf("Sending: to %s:%d, \n%s.\n",			msg->via2.host, 			(unsigned short)msg->via2.port,			new_buf);	/* fork? gethostbyname will probably block... */	he=gethostbyname(msg->via2.host);	if (he==0){		DPrint("ERROR:forward_reply:gethostbyname failure\n");		goto error;	}	to->sin_family = AF_INET;	to->sin_port = (msg->via2.port)?htons(msg->via2.port):htons(SIP_PORT);	to->sin_addr.s_addr=*((long*)he->h_addr_list[0]);		if (udp_send(new_buf,new_len, &to, sizeof(to))==-1)		goto error;		free(new_buf);	free(to);	return 0;error:	if (new_buf) free(new_buf);	if (to) free(to);	return -1;}