[OpenSIPS-Users] IP check in FixContact (nat_traversal.c)

Dan Pascu dan at ag-projects.com
Wed Feb 25 10:06:03 CET 2009


On Tuesday 24 February 2009, Bogdan-Andrei Iancu wrote:
> Hi Thomas,
>
> this looks like a bug to me - indeed both IP and port should be checked
> in order to make sense to the check. Dan? any comments here?

It seems to be a remnant from the time when asymmetric clients were 
supported. As it looks, both the ip and port should be checked.

> I know for sure that the fix_nated_contact() from nathepler module
> works ok in such a scenario.

Because it doesn't check anything, instead it changes them even if they 
are the same.

>
> Regards,
> Bogdan
>
> Thomas Gelf wrote:
> > Hi list,
> >
> > I had some trouble using fix_contact (from nat_traversal modul) with
> > clients using STUN behind symmetric NAT setting Contact to "correct"
> > IP and wrong port number. There is a hardcoded check in the
> > FixContact
> >
> > function silently ignoring my fix_contact()-call in such scenarios:
> >> if(newiplen==uri.host.len && memcmp(uri.host.s,newip,newiplen)==0)
> >
> > Imo this check should be relaxed/extended to compare ip AND/OR port
> > changes. As I'm not used to write C code I just removed this check
> > (as I'm calling fix_contact() only where necessary this should also
> > be fine) and right now fix_contact() works great and does what it is
> > expected to do.
> >
> > Same issue should also to be found in OpenSER's fix_contact belonging
> > to the mediaproxy module.
> >
> > Best regards
> > Thomas Gelf
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users



-- 
Dan



More information about the Users mailing list