[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:09:28 CST 2009


The following issue has been UPDATED. 
====================================================================== 
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:09 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.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-12-02 11:09 dvossel        Status                   assigned => closed  
======================================================================




More information about the asterisk-bugs mailing list