diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-06-03 16:24:15 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-06-03 16:24:15 +0100 |
commit | 813f1f407f639c1f025298abae9fd0295a30d24c (patch) | |
tree | 97d62a546789698af9be1d4b6aac1183e4f9efd2 /src/lua_worker.c | |
parent | f2c442c62951e1441493797268bb36f5da635ee4 (diff) | |
download | rspamd-813f1f407f639c1f025298abae9fd0295a30d24c.tar.gz rspamd-813f1f407f639c1f025298abae9fd0295a30d24c.zip |
Fix some warnings that actually are dangerous.
Diffstat (limited to 'src/lua_worker.c')
-rw-r--r-- | src/lua_worker.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lua_worker.c b/src/lua_worker.c index c4276968a..723c48707 100644 --- a/src/lua_worker.c +++ b/src/lua_worker.c @@ -381,6 +381,20 @@ lua_accept_socket (gint fd, short what, void *arg) sizeof (struct in_addr)); addr_str = g_strdup (inet_ntoa (su.s4.sin_addr)); } + else if (su.ss.ss_family == AF_INET6) { + addr_str = g_malloc0 (INET6_ADDRSTRLEN + 1); + /* XXX: support ipv6 addresses here */ + addr.s_addr = INADDR_NONE; + inet_ntop (AF_INET6, &su.s6.sin6_addr, addr_str, INET6_ADDRSTRLEN); + msg_info ("accepted connection from [%s] port %d", + addr_str, ntohs (su.s6.sin6_port)); + } + else { + addr.s_addr = INADDR_NONE; + msg_err ("accepted connection from unsupported address family: %d", su.ss.ss_family); + close (nfd); + return; + } /* Call finalizer function */ lua_rawgeti (L, LUA_REGISTRYINDEX, ctx->cbref_accept); |