summaryrefslogtreecommitdiffhomepage
path: root/src/mail
diff options
context:
space:
mode:
Diffstat (limited to 'src/mail')
-rw-r--r--src/mail/ngx_mail.c6
-rw-r--r--src/mail/ngx_mail_core_module.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c
index 3812e1517..b0da78605 100644
--- a/src/mail/ngx_mail.c
+++ b/src/mail/ngx_mail.c
@@ -465,7 +465,8 @@ ngx_mail_add_addrs(ngx_conf_t *cf, ngx_mail_port_t *mport,
addrs[i].conf.ssl = addr[i].ssl;
#endif
- len = ngx_sock_ntop(addr[i].sockaddr, buf, NGX_SOCKADDR_STRLEN, 1);
+ len = ngx_sock_ntop(addr[i].sockaddr, addr[i].socklen , buf,
+ NGX_SOCKADDR_STRLEN, 1);
p = ngx_pnalloc(cf->pool, len);
if (p == NULL) {
@@ -513,7 +514,8 @@ ngx_mail_add_addrs6(ngx_conf_t *cf, ngx_mail_port_t *mport,
addrs6[i].conf.ssl = addr[i].ssl;
#endif
- len = ngx_sock_ntop(addr[i].sockaddr, buf, NGX_SOCKADDR_STRLEN, 1);
+ len = ngx_sock_ntop(addr[i].sockaddr, addr[i].socklen, buf,
+ NGX_SOCKADDR_STRLEN, 1);
p = ngx_pnalloc(cf->pool, len);
if (p == NULL) {
diff --git a/src/mail/ngx_mail_core_module.c b/src/mail/ngx_mail_core_module.c
index be8673c29..4ee7c8dc3 100644
--- a/src/mail/ngx_mail_core_module.c
+++ b/src/mail/ngx_mail_core_module.c
@@ -439,7 +439,8 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ls->bind = 1;
} else {
- len = ngx_sock_ntop(sa, buf, NGX_SOCKADDR_STRLEN, 1);
+ len = ngx_sock_ntop(sa, ls->socklen, buf,
+ NGX_SOCKADDR_STRLEN, 1);
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"ipv6only is not supported "