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

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


The following issue has been ASSIGNED. 
====================================================================== 
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:                     assigned
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:              
====================================================================== 
Date Submitted:             2011-04-29 01:54 CDT
Last Modified:              2011-05-03 17:13 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
====================================================================== 

---------------------------------------------------------------------- 
 (0134374) svnbot (reporter) - 2011-05-03 17:13
 https://issues.asterisk.org/view.php?id=19200#c134374 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 316336

U   branches/1.8/channels/chan_mgcp.c
U   branches/1.8/channels/chan_skinny.c
U   branches/1.8/pbx/pbx_dundi.c

------------------------------------------------------------------------
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=316336 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-03 17:13 svnbot         Checkin                                      
2011-05-03 17:13 svnbot         Note Added: 0134374                          
2011-05-03 17:13 svnbot         Status                   new => assigned     
2011-05-03 17:13 svnbot         Assigned To               => russell         
======================================================================




More information about the asterisk-bugs mailing list