Commit 2159af90 authored by Simon Morlat's avatar Simon Morlat

clean local loopback handling in tport.c

parent dec2d85c
......@@ -11,7 +11,7 @@ dnl information on the package
dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
AC_INIT([sofia-sip], [1.13.13bc])
AC_INIT([sofia-sip], [1.13.14bc])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.13])
......
......@@ -4681,15 +4681,18 @@ tport_t *tport_by_name(tport_t const *tp, tp_name_t const *tpn)
nocomp = self;
continue;
}
if (family == AF_INET && tpn->tpn_host && strcmp(tpn->tpn_host, "127.0.0.1") == 0 && ntohl(tp->tp_addr->su_sin.sin_addr.s_addr) == INADDR_LOOPBACK) {
SU_DEBUG_7(("tport: default primary changed to AF_INET loopback\n"));
default_primary = tp;
} else if (family == AF_INET6 && tpn->tpn_host && strcmp(tpn->tpn_host, "::1") == 0 && IN6_IS_ADDR_LOOPBACK(&tp->tp_addr->su_sin6.sin6_addr)) {
SU_DEBUG_7(("tport: default primary changed to AF_INET6 loopback\n"));
default_primary = tp;
}
if (!default_primary) {
default_primary=tp;
} else if (tpn->tpn_host && (strcmp(tpn->tpn_host, "127.0.0.1") == 0 || strcmp(tpn->tpn_host, "::1")) == 0) {
if ((family == AF_INET && ntohl(tp->tp_addr->su_sin.sin_addr.s_addr) == INADDR_LOOPBACK) ||
(family == AF_INET6 && IN6_IS_ADDR_LOOPBACK(&tp->tp_addr->su_sin6.sin6_addr))) {
SU_DEBUG_7(("tport: default primary changed to loopback\n"));
default_primary = tp;
}
}
secondary=tport_by_name_from_primary(tp,tpn);
if (secondary) {
......
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