Commit 14acceee authored by Pekka Pessi's avatar Pekka Pessi

Fixed bug #1473936 in tport/tport.c.

tport_primary_by_name() now returns transports regardless of their protocol
family if tpn->tpn_host is not a literal IP address.

darcs-hash:20060426163427-65a35-c6622e71edf1949eaf781b28c85b18c70caeb10a.gz
parent e2746794
...@@ -54,6 +54,7 @@ typedef struct tport_nat_s tport_nat_t; ...@@ -54,6 +54,7 @@ typedef struct tport_nat_s tport_nat_t;
#include <sofia-sip/msg.h> #include <sofia-sip/msg.h>
#include <sofia-sip/msg_addr.h> #include <sofia-sip/msg_addr.h>
#include <sofia-sip/hostdomain.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
...@@ -4010,11 +4011,13 @@ tport_t *tport_primary_by_name(tport_t const *tp, tp_name_t const *tpn) ...@@ -4010,11 +4011,13 @@ tport_t *tport_primary_by_name(tport_t const *tp, tp_name_t const *tpn)
if (tpn->tpn_host == NULL) if (tpn->tpn_host == NULL)
family = 0; family = 0;
#if SU_HAVE_IN6 #if SU_HAVE_IN6
else if (strchr(tpn->tpn_host, ':')) else if (host_is_ip6_address(tpn->tpn_host))
family = AF_INET6; family = AF_INET6;
#endif #endif
else if (strcmp(tpn->tpn_host, tpn_any)) else if (host_is_ip4_address(tpn->tpn_host))
family = AF_INET; family = AF_INET;
else
family = 0;
if (proto && strcmp(proto, tpn_any) == 0) if (proto && strcmp(proto, tpn_any) == 0)
proto = NULL; proto = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment