rem: if (mhomed && proto==PROTO_UDP) return get_out_socket(to, proto);
add: if (mhomed && proto==PROTO_UDP){ send_sock=get_out_socket(to, proto); if ((send_sock==0) || (send_sock->socket!=-1)) return send_sock;  else if (send_sock->socket==-1){ LOG(L_WARN, "WARNING: get_send_socket: not listening on the" " requested socket, no fork mode?\n");  } }
context: struct socket_info* get_send_socket(struct sip_msg *msg, 										union sockaddr_union* to, int proto){	struct socket_info* send_sock;		/* check if send interface is not forced */	if (msg && msg->force_send_socket){		if (msg->force_send_socket->proto!=proto){			DBG("get_send_socket: force_send_socket of different proto"					" (%d)!\n", proto);			msg->force_send_socket=find_si(&(msg->force_send_socket->address),											msg->force_send_socket->port_no,											proto);		}		if (msg->force_send_socket) 			return msg->force_send_socket;		else			LOG(L_WARN, "WARNING: get_send_socket: protocol/port mismatch\n");	};	if (mhomed && proto==PROTO_UDP) return get_out_socket(to, proto);	send_sock=0;	/* check if we need to change the socket (different address families -	 * eg: ipv4 -> ipv6 or ipv6 -> ipv4) */	switch(proto){#ifdef USE_TCP		case PROTO_TCP:		/* on tcp just use the "main address", we don't really now the		 * sending address (we can find it out, but we'll need also to see		 * if we listen on it, and if yes on which port -> too complicated*/			switch(to->s.sa_family){				/* FIXME */				case AF_INET:	send_sock=sendipv4_tcp;								break;#ifdef USE_IPV6				case AF_INET6:	send_sock=sendipv6_tcp;								break;#endif				default:	LOG(L_ERR, "get_send_socket: BUG: don't know how"									" to forward to af %d\n", to->s.sa_family);			}			break;#endif#ifdef USE_TLS		case PROTO_TLS:			switch(to->s.sa_family){				/* FIXME */				case AF_INET:	send_sock=sendipv4_tls;								break;#ifdef USE_IPV6				case AF_INET6:	send_sock=sendipv6_tls;								break;#endif				default:	LOG(L_ERR, "get_send_socket: BUG: don't know how"									" to forward to af %d\n", to->s.sa_family);			}			break;#endif /* USE_TLS */		case PROTO_UDP:			if ((bind_address==0)||(to->s.sa_family!=bind_address->address.af)||				  (bind_address->proto!=PROTO_UDP)){				switch(to->s.sa_family){					case AF_INET:	send_sock=sendipv4;									break;#ifdef USE_IPV6					case AF_INET6:	send_sock=sendipv6;									break;#endif					default:	LOG(L_ERR, "get_send_socket: BUG: don't know"										" how to forward to af %d\n",										to->s.sa_family);				}			}else send_sock=bind_address;			break;		default:			LOG(L_CRIT, "BUG: get_send_socket: unknown proto %d\n", proto);	}	return send_sock;}