rem: len=sockaddru_len(from);
add: len=sizeof(from);
context: struct socket_info* get_out_socket(union sockaddr_union* to, int proto){	int temp_sock;	socklen_t len;	int r;	union sockaddr_union from; 	if (proto!=PROTO_UDP) {		LOG(L_CRIT, "BUG: get_out_socket can only be called for UDP\n");		return 0;	}	r=-1;	temp_sock=socket(to->s.sa_family, SOCK_DGRAM, 0 );	if (temp_sock==-1) {		LOG(L_ERR, "ERROR: get_out_socket: socket() failed: %s\n",				strerror(errno));		return 0;	}	if (connect(temp_sock, &to->s, sockaddru_len(*to))==-1) {		LOG(L_ERR, "ERROR: get_out_socket: connect failed: %s\n",				strerror(errno));		goto error;	}	len=sockaddru_len(from);	if (getsockname(temp_sock, &from.s, &len)==-1) {		LOG(L_ERR, "ERROR: get_out_socket: getsockname failed: %s\n",				strerror(errno));		goto error;	}	for (r=0; r<sock_no; r++) {		switch(from.s.sa_family) {			case AF_INET:							if (sock_info[r].address.af!=AF_INET)								continue;						if (memcmp(&sock_info[r].address.u,								&from.sin.sin_addr, 								sock_info[r].address.len)==0)							goto error; /* it is actually success */						break;#if defined(USE_IPV6)			case AF_INET6:							if (sock_info[r].address.af!=AF_INET6)								continue;						if (memcmp(&sock_info[r].address.u,								&from.sin6.sin6_addr, len)==0)							goto error;						continue;#endif			default:	LOG(L_ERR, "ERROR: get_out_socket: "									"unknown family: %d\n",									from.s.sa_family);						r=-1;						goto error;		}	}	LOG(L_ERR, "ERROR: get_out_socket: no socket found\n");	r=-1;error:	close(temp_sock);	DBG("DEBUG: get_out_socket: socket determined: %d\n", r );	return r==-1? 0: &sock_info[r];}