]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use htons() instead of ntohs() in some places.
authorRussell Bryant <russell@russellbryant.com>
Tue, 3 May 2011 22:13:31 +0000 (22:13 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 3 May 2011 22:13:31 +0000 (22:13 +0000)
(closes issue #19200)
Reported by: wdoekes
Patches:
      issue19200-trunk.patch uploaded by wdoekes (license 717)
      issue19200-1.8.x.patch uploaded by wdoekes (license 717)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316336 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_mgcp.c
channels/chan_skinny.c
pbx/pbx_dundi.c

index ea5af86df8a91bb38cc9bd60a136feb50c00af19..ba159c2376ff0d432d4ff781f23927131ec904b9 100644 (file)
@@ -4730,7 +4730,7 @@ static int reload_config(int reload)
                memcpy(&__ourip, hp->h_addr, sizeof(__ourip));
        }
        if (!ntohs(bindaddr.sin_port))
-               bindaddr.sin_port = ntohs(DEFAULT_MGCP_CA_PORT);
+               bindaddr.sin_port = htons(DEFAULT_MGCP_CA_PORT);
        bindaddr.sin_family = AF_INET;
        ast_mutex_lock(&netlock);
        if (mgcpsock > -1)
index 59a61f6860bbd2f61131d4a4b2ab89efb24d29ff..d8e399741b4271b9562abc858dd101f7e293906c 100644 (file)
@@ -7241,7 +7241,7 @@ static struct ast_channel *skinny_request(const char *type, format_t format, con
                memcpy(&__ourip, hp->h_addr, sizeof(__ourip));
        }
        if (!ntohs(bindaddr.sin_port)) {
-               bindaddr.sin_port = ntohs(DEFAULT_SKINNY_PORT);
+               bindaddr.sin_port = htons(DEFAULT_SKINNY_PORT);
        }
        bindaddr.sin_family = AF_INET;
 
index 2c3cf1ab21c978b5a38b1bf3353421b433fc98f6..ac0c21c19e405ed4bb43333cdaf00ca59fd35ad8 100644 (file)
@@ -4678,7 +4678,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin, int reload)
        v = ast_variable_browse(cfg, "general");
        while(v) {
                if (!strcasecmp(v->name, "port")){
-                       sin->sin_port = ntohs(atoi(v->value));
+                       sin->sin_port = htons(atoi(v->value));
                        if(last_port==0){
                                last_port=sin->sin_port;
                        } else if(sin->sin_port != last_port)
@@ -4831,7 +4831,7 @@ static int load_module(void)
        dundi_set_error(dundi_error_output);
 
        sin.sin_family = AF_INET;
-       sin.sin_port = ntohs(DUNDI_PORT);
+       sin.sin_port = htons(DUNDI_PORT);
        sin.sin_addr.s_addr = INADDR_ANY;
 
        /* Make a UDP socket */