[asterisk-bugs] [Asterisk 0019200]: [patch] sometimes ntohs in place of htons

Asterisk Bug Tracker noreply at bugs.digium.com
Tue May 3 17:16:25 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19200 
====================================================================== 
Reported By:                wdoekes
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   19200
Category:                   General
Reproducibility:            always
Severity:                   trivial
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 315895 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2011-04-29 01:54 CDT
Last Modified:              2011-05-03 17:16 CDT
====================================================================== 
Summary:                    [patch] sometimes ntohs in place of htons
Description: 
Hi,

in a couple of places ntohs is used where htons should be used. This is
not a problem, as they should both be a no-op (big endian) or both swap the
bytes (little endian).

asterisk-svn$ wgrep . 'sin_port = ntohs'
./channels/chan_skinny.c:		bindaddr.sin_port =
ntohs(DEFAULT_SKINNY_PORT);
./channels/chan_mgcp.c:		bindaddr.sin_port = ntohs(DEFAULT_MGCP_CA_PORT);
./pbx/pbx_dundi.c:			sin->sin_port = ntohs(atoi(v->value));
./pbx/pbx_dundi.c:	sin.sin_port = ntohs(DUNDI_PORT);

asterisk-1.6.2.x$ wgrep . 'sin_port = ntohs'
./channels/chan_skinny.c:		bindaddr.sin_port =
ntohs(DEFAULT_SKINNY_PORT);
./channels/chan_mgcp.c:		bindaddr.sin_port = ntohs(DEFAULT_MGCP_CA_PORT);
./channels/chan_sip.c:			p->ourip.sin_port = ntohs(port);
./pbx/pbx_dundi.c:			sin->sin_port = ntohs(atoi(v->value));
./pbx/pbx_dundi.c:	sin.sin_port = ntohs(DUNDI_PORT);


Fix: s/ntohs/htons/ in the above locations.


Regards,
Walter
====================================================================== 

---------------------------------------------------------------------- 
 (0134375) svnbot (reporter) - 2011-05-03 17:16
 https://issues.asterisk.org/view.php?id=19200#c134375 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 316337

_U  trunk/
U   trunk/channels/chan_mgcp.c
U   trunk/channels/chan_skinny.c
U   trunk/pbx/pbx_dundi.c

------------------------------------------------------------------------
r316337 | russell | 2011-05-03 17:16:24 -0500 (Tue, 03 May 2011) | 15
lines

Merged revisions 316336 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316336 | russell | 2011-05-03 17:13:31 -0500 (Tue, 03 May 2011) | 8
lines
  
  Use htons() instead of ntohs() in some places.
  
  (closes issue https://issues.asterisk.org/view.php?id=19200)
  Reported by: wdoekes
  Patches:
        issue19200-trunk.patch uploaded by wdoekes (license 717)
        issue19200-1.8.x.patch uploaded by wdoekes (license 717)
........

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-03 17:16 svnbot         Checkin                                      
2011-05-03 17:16 svnbot         Note Added: 0134375                          
======================================================================




More information about the asterisk-bugs mailing list