diff options
| author | Ruslan Ermilov <ru@nginx.com> | 2016-05-23 16:37:20 +0300 |
|---|---|---|
| committer | Ruslan Ermilov <ru@nginx.com> | 2016-05-23 16:37:20 +0300 |
| commit | fd064d3b88e59ee71aec508687403539b01d643c (patch) | |
| tree | 8cec8e57171f8484d0e720b51b331e716d843a1d /src/mail | |
| parent | d650688ba5f966bd13b5449b52192b19a4715ee4 (diff) | |
| download | nginx-fd064d3b88e59ee71aec508687403539b01d643c.tar.gz nginx-fd064d3b88e59ee71aec508687403539b01d643c.tar.bz2 | |
Introduced the ngx_sockaddr_t type.
It's properly aligned and can hold any supported sockaddr.
Diffstat (limited to 'src/mail')
| -rw-r--r-- | src/mail/ngx_mail.h | 12 | ||||
| -rw-r--r-- | src/mail/ngx_mail_core_module.c | 2 |
2 files changed, 2 insertions, 12 deletions
diff --git a/src/mail/ngx_mail.h b/src/mail/ngx_mail.h index cc5b15c2d..277f92060 100644 --- a/src/mail/ngx_mail.h +++ b/src/mail/ngx_mail.h @@ -27,17 +27,7 @@ typedef struct { typedef struct { - union { - struct sockaddr sockaddr; - struct sockaddr_in sockaddr_in; -#if (NGX_HAVE_INET6) - struct sockaddr_in6 sockaddr_in6; -#endif -#if (NGX_HAVE_UNIX_DOMAIN) - struct sockaddr_un sockaddr_un; -#endif - } u; - + ngx_sockaddr_t u; socklen_t socklen; /* server ctx */ diff --git a/src/mail/ngx_mail_core_module.c b/src/mail/ngx_mail_core_module.c index f3852bf36..89f835d5d 100644 --- a/src/mail/ngx_mail_core_module.c +++ b/src/mail/ngx_mail_core_module.c @@ -337,7 +337,7 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ngx_memzero(ls, sizeof(ngx_mail_listen_t)); - ngx_memcpy(&ls->u.sockaddr, u.sockaddr, u.socklen); + ngx_memcpy(&ls->u.sockaddr, &u.sockaddr, u.socklen); ls->socklen = u.socklen; ls->backlog = NGX_LISTEN_BACKLOG; |
