[OpenSIPS-Devel] SF.net SVN: opensips:[5933] branches/1.5

Dan Pascu dan at ag-projects.com
Wed Aug 5 00:31:45 CEST 2009


On Tuesday 04 August 2009, Bogdan-Andrei Iancu wrote:
> I thought of this in the first thing, but (as documented), if the the 
> port or proto is missing, the grep function assumes ANY and not a 
> default value. And actually the function is used in other part with the 
> ANY behaviour.

Anyway, in the case of the nat_traversal module, the fix is only if one wants 
to be extremely cautious. The values the nat_traversal reads are the ones that 
were written by itself at shutdown. The only way to read something invalid 
back is if the user modifies it, however the file has an explicit and strong 
warning against being modified. Finally, if one ignores the warning and still 
modifies the file, then I don't think that adding the default port would help 
in any way, as if the socket address may not be right (port may be different), 
NAT cannot be traversed back, so I think the original behavior or ignoring 
that entry because it doesn't match any entry in the socket list is better 
than trying to send from the wrong port, which would not work anyway.

> 
> Regards,
> Bogdan
> 
> Dan Pascu wrote:
> > On Tuesday 04 August 2009, Bogdan-Andrei Iancu wrote:
> >   
> >> Revision: 5933
> >>           http://opensips.svn.sourceforge.net/opensips/?rev=5933&view=rev
> >> Author:   bogdan_iancu
> >> Date:     2009-08-04 16:45:55 +0000 (Tue, 04 Aug 2009)
> >>
> >> Log Message:
> >> -----------
> >> backport from trunk (rev #5916):
> >> - fixed setting default values for SIP port and proto when greaping for a 
> >> socket; the function ignore the port / proto if zero, but the parsing 
> >> functions set them to 0 if they do not exist (in uris).
> >>     
> >
> > Wouldn't it be better if the parsing function would return the correct 
default 
> > ports based on protocol, when missing, instead of returning 0 and 
requiring 
> > the user to call another macro after that just to fix it?
> >
> >   
> >>   Closes bug id #2827960
> >>   Credits go to Peter Baer.
> >>
> >> Revision Links:
> >> --------------
> >>     http://opensips.svn.sourceforge.net/opensips/?rev=5916&view=rev
> >>
> >> Modified Paths:
> >> --------------
> >>     branches/1.5/modules/nat_traversal/nat_traversal.c
> >>     branches/1.5/modules/registrar/save.c
> >>     branches/1.5/modules/rr/loose.c
> >>     branches/1.5/modules/tm/mi.c
> >>     branches/1.5/pvar.c
> >>     branches/1.5/socket_info.h
> >>
> >>
> >> This was sent by the SourceForge.net collaborative development platform, 
the 
> >>     
> > world's largest Open Source development site.
> >   
> >> _______________________________________________
> >> Devel mailing list
> >> Devel at lists.opensips.org
> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
> >>
> >>
> >>     
> >
> >
> >   
> 
> 


-- 
Dan



More information about the Devel mailing list