From 405c966a4fb214edc0d2f2ba62dd238466551241 Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 27 Apr 2010 13:56:37 -0500 Subject: [PATCH] evil nat scenarios --- src/mod/endpoints/mod_sofia/sofia_presence.c | 5 +++++ src/mod/endpoints/mod_sofia/sofia_reg.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 2a9296bb6b..d84d764efb 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -1751,6 +1751,11 @@ void sofia_presence_handle_sip_i_subscribe(int status, } } + if (!is_nat && sip && sip->sip_via && sip->sip_via->v_port && + atoi(sip->sip_via->v_port) == 5060 && network_port != 5060 ) { + is_nat = "via port"; + } + if (!is_nat && profile->nat_acl_count) { uint32_t x = 0; int ok = 1; diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index d9c60aa5a6..1f07b944ef 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -1364,6 +1364,11 @@ void sofia_reg_handle_sip_i_register(nua_t *nua, sofia_profile_t *profile, nua_h } } + if (!is_nat && sip && sip->sip_via && sip->sip_via->v_port && + atoi(sip->sip_via->v_port) == 5060 && network_port != 5060 ) { + is_nat = "via port"; + } + if (!is_nat && profile->nat_acl_count) { uint32_t x = 0; int ok = 1;