[Home]

Summary:ASTERISK-15180: ast_ouraddrfor doesn't do htons() on the port
Reporter:Walter Doekes (wdoekes)Labels:
Date Opened:2009-11-20 04:53:21.000-0600Date Closed:2009-12-02 11:11:02.000-0600
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:In main/acl.c, in function ast_ouraddrfor when setting sin.sin_port, no host to network order translation is performed on the port number (5060).

As long as no firewall rules trip over this during connect(2) (haven't tested whether this could actually be an issue) this is no problem at all, as no packets are actually sent.

But, if you're doing an strace, it looks kind of odd. It had me puzzled for a while.


Suggested fix:
- Either add htons() around the 5060.
- Or add a comment about 50195 after the 5060 so it can be found when grepping the source.


Regards,
Walter Doekes
OSSO B.V.
Comments:By: Digium Subversion (svnbot) 2009-12-02 11:06:54.000-0600

Repository: asterisk
Revision: 232350

U   branches/1.4/main/acl.c

------------------------------------------------------------------------
r232350 | dvossel | 2009-12-02 11:06:53 -0600 (Wed, 02 Dec 2009) | 6 lines

ast_outaddrfor doesn't do htons() on port, looks odd in strace.

(closes issue ASTERISK-15180)
Reported by: wdoekes


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

http://svn.digium.com/view/asterisk?view=rev&revision=232350

By: Digium Subversion (svnbot) 2009-12-02 11:07:51.000-0600

Repository: asterisk
Revision: 232351

_U  trunk/
U   trunk/main/acl.c

------------------------------------------------------------------------
r232351 | dvossel | 2009-12-02 11:07:50 -0600 (Wed, 02 Dec 2009) | 12 lines

Merged revisions 232350 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r232350 | dvossel | 2009-12-02 10:59:18 -0600 (Wed, 02 Dec 2009) | 6 lines
 
 ast_outaddrfor doesn't do htons() on port, looks odd in strace.
 
 (closes issue ASTERISK-15180)
 Reported by: wdoekes
........

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

http://svn.digium.com/view/asterisk?view=rev&revision=232351

By: Digium Subversion (svnbot) 2009-12-02 11:08:52.000-0600

Repository: asterisk
Revision: 232352

_U  branches/1.6.2/
U   branches/1.6.2/main/acl.c

------------------------------------------------------------------------
r232352 | dvossel | 2009-12-02 11:08:52 -0600 (Wed, 02 Dec 2009) | 19 lines

Merged revisions 232351 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r232351 | dvossel | 2009-12-02 11:00:15 -0600 (Wed, 02 Dec 2009) | 12 lines
 
 Merged revisions 232350 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r232350 | dvossel | 2009-12-02 10:59:18 -0600 (Wed, 02 Dec 2009) | 6 lines
   
   ast_outaddrfor doesn't do htons() on port, looks odd in strace.
   
   (closes issue ASTERISK-15180)
   Reported by: wdoekes
 ........
................

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

http://svn.digium.com/view/asterisk?view=rev&revision=232352

By: Digium Subversion (svnbot) 2009-12-02 11:10:06.000-0600

Repository: asterisk
Revision: 232353

_U  branches/1.6.1/
U   branches/1.6.1/main/acl.c

------------------------------------------------------------------------
r232353 | dvossel | 2009-12-02 11:10:05 -0600 (Wed, 02 Dec 2009) | 19 lines

Merged revisions 232351 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r232351 | dvossel | 2009-12-02 11:00:15 -0600 (Wed, 02 Dec 2009) | 12 lines
 
 Merged revisions 232350 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r232350 | dvossel | 2009-12-02 10:59:18 -0600 (Wed, 02 Dec 2009) | 6 lines
   
   ast_outaddrfor doesn't do htons() on port, looks odd in strace.
   
   (closes issue ASTERISK-15180)
   Reported by: wdoekes
 ........
................

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

http://svn.digium.com/view/asterisk?view=rev&revision=232353

By: Digium Subversion (svnbot) 2009-12-02 11:11:02.000-0600

Repository: asterisk
Revision: 232354

_U  branches/1.6.0/
U   branches/1.6.0/main/acl.c

------------------------------------------------------------------------
r232354 | dvossel | 2009-12-02 11:11:02 -0600 (Wed, 02 Dec 2009) | 19 lines

Merged revisions 232351 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r232351 | dvossel | 2009-12-02 11:00:15 -0600 (Wed, 02 Dec 2009) | 12 lines
 
 Merged revisions 232350 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r232350 | dvossel | 2009-12-02 10:59:18 -0600 (Wed, 02 Dec 2009) | 6 lines
   
   ast_outaddrfor doesn't do htons() on port, looks odd in strace.
   
   (closes issue ASTERISK-15180)
   Reported by: wdoekes
 ........
................

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

http://svn.digium.com/view/asterisk?view=rev&revision=232354