[asterisk-bugs] [Asterisk 0016290]: ast_ouraddrfor doesn't do htons() on the port

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Dec 2 11:11:02 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16290 
====================================================================== 
Reported By:                wdoekes
Assigned To:                dvossel
====================================================================== 
Project:                    Asterisk
Issue ID:                   16290
Category:                   Core/General
Reproducibility:            always
Severity:                   trivial
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
JIRA:                       SWP-443 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-11-20 04:53 CST
Last Modified:              2009-12-02 11:11 CST
====================================================================== 
Summary:                    ast_ouraddrfor doesn't do htons() on the port
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.
====================================================================== 

---------------------------------------------------------------------- 
 (0114535) svnbot (reporter) - 2009-12-02 11:11
 https://issues.asterisk.org/view.php?id=16290#c114535 
---------------------------------------------------------------------- 
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 https://issues.asterisk.org/view.php?id=16290)
    Reported by: wdoekes
  ........
................

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-12-02 11:11 svnbot         Checkin                                      
2009-12-02 11:11 svnbot         Note Added: 0114535                          
======================================================================




More information about the asterisk-bugs mailing list