[OpenSIPS-Devel] [ opensips-Bugs-2474548 ] [nat_traversal] client_nat_test("2") shouldn't match port

SourceForge.net noreply at sourceforge.net
Mon Dec 29 10:52:57 CET 2008


Bugs item #2474548, was opened at 2008-12-29 10:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2474548&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: trunk
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Iñaki Baz (ibc_sf)
Assigned to: Nobody/Anonymous (nobody)
Summary: [nat_traversal] client_nat_test("2") shouldn't match port

Initial Comment:
nat_traversal client_nat_test() function has the following parameter:

--------
1 - tests if client has a private IP address (as defined by RFC1918) in the Contact field of the SIP message. 

2 - tests if client has contacted OpenSIPS from an address that is different from the one in the Via field. Both the IP and port are compared by this test.

4 - tests if client has a private IP address (as defined by RFC1918) in the top Via field of the SIP message.
---------


Imagine we use client_nat_test(2) and there is a phone with public IP using SIP TCP. This client will ALWAYS detected as "natted" since the source port will never match its listening port (5060, the port indicated in Via sent-by field).

I think that the port shouldn't be matched. Also note that nathelper nat_uac_test() function has two values for same purpose:

--------
2 - the "received" test is used: address in Via is compared against source IP address of signaling 

16 - test if the source port is different from the port in Via
--------

nat_uac_test(2) and nat_uac_test(18) is valid for UDP clients while in case of TCP clients the only valid value is nat_uac_test(2).


So I suggest to split the nat_traversal client_nat_test() parameter 2 into 2 and 8, so it would be:

--------
1 - tests if client has a private IP address (as defined by RFC1918) in the Contact field of the SIP message. 

2 - tests if client has contacted OpenSIPS from an IP that is different from the one in the Via field.

4 - tests if client has a private IP address (as defined by RFC1918) in the top Via field of the SIP message.

8- test if the source port is different from the port in Via.
---------

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2474548&group_id=232389



More information about the Devel mailing list