From f12c7563e2523e268075bb1acc254ea30d536840 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Fri, 17 Aug 2012 05:08:42 +0000 Subject: Mail: fixed sorting of listen addresses (ticket #187). For http module this problem was already fixed in r4756. --- src/mail/ngx_mail.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mail/ngx_mail.c') diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c index 49ec2e05b..b097778db 100644 --- a/src/mail/ngx_mail.c +++ b/src/mail/ngx_mail.c @@ -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; -- cgit