]> git.kaiwu.me - nginx.git/commitdiff
Mail: fixed sorting of listen addresses (ticket #187).
authorRuslan Ermilov <ru@nginx.com>
Fri, 17 Aug 2012 05:08:42 +0000 (05:08 +0000)
committerRuslan Ermilov <ru@nginx.com>
Fri, 17 Aug 2012 05:08:42 +0000 (05:08 +0000)
For http module this problem was already fixed in r4756.

src/mail/ngx_mail.c

index 49ec2e05b4ddef76415b3e60f511338105493840..b097778db107f9e77e25e5ca92f0157ecfff489c 100644 (file)
@@ -539,6 +539,11 @@ ngx_mail_cmp_conf_addrs(const void *one, const void *two)
         return 1;
     }
 
+    if (second->wildcard) {
+        /* a wildcard must be the last resort, shift it to the end */
+        return -1;
+    }
+
     if (first->bind && !second->bind) {
         /* shift explicit bind()ed addresses to the start */
         return -1;