]> git.kaiwu.me - nginx.git/commitdiff
Mail: fixed the duplicate listen address detection.
authorRuslan Ermilov <ru@nginx.com>
Fri, 23 Jan 2015 12:23:29 +0000 (15:23 +0300)
committerRuslan Ermilov <ru@nginx.com>
Fri, 23 Jan 2015 12:23:29 +0000 (15:23 +0300)
src/mail/ngx_mail_core_module.c

index a5388c8470e55afc2085799492c7b956253a7c51..05a47f5e33a42f24198f64e4713e416f3b40f0af 100644 (file)
@@ -336,7 +336,7 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
             off = offsetof(struct sockaddr_in6, sin6_addr);
             len = 16;
             sin6 = (struct sockaddr_in6 *) sa;
-            port = sin6->sin6_port;
+            port = ntohs(sin6->sin6_port);
             break;
 #endif
 
@@ -352,7 +352,7 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
             off = offsetof(struct sockaddr_in, sin_addr);
             len = 4;
             sin = (struct sockaddr_in *) sa;
-            port = sin->sin_port;
+            port = ntohs(sin->sin_port);
             break;
         }