aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Fabio Bas2009-03-10 09:54:41 +0000
committerGravatar Fabio Bas2009-03-10 09:54:41 +0000
commitf7d751520cd72d6edc889fbbc16b3effdf4cc6f4 (patch)
tree4dd7adc1b9bd8da26c65f3b37c58a749c7519e1b
parenttypo, thx to Kuja^ (diff)
downloadKVIrc-f7d751520cd72d6edc889fbbc16b3effdf4cc6f4.tar.gz
KVIrc-f7d751520cd72d6edc889fbbc16b3effdf4cc6f4.tar.bz2
KVIrc-f7d751520cd72d6edc889fbbc16b3effdf4cc6f4.zip
preliminary patch for #393 (wip)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3122 17fca916-40b9-46aa-a4ea-0a15b648b75c
-rw-r--r--src/kvilib/net/kvi_socket.h5
-rw-r--r--src/modules/ident/libkviident.cpp9
2 files changed, 13 insertions, 1 deletions
diff --git a/src/kvilib/net/kvi_socket.h b/src/kvilib/net/kvi_socket.h
index a201a49d5..295b60f19 100644
--- a/src/kvilib/net/kvi_socket.h
+++ b/src/kvilib/net/kvi_socket.h
@@ -46,6 +46,10 @@
#define KVI_INVALID_SOCKET INVALID_SOCKET
+ #define KVI_IPV6_PROTECTION_LEVEL IPV6_PROTECTION_LEVEL
+ #define KVI_PROTECTION_LEVEL_RESTRICTED 10 /* for Intranet apps */
+ #define KVI_PROTECTION_LEVEL_DEFAULT 20 /* default level */
+ #define KVI_PROTECTION_LEVEL_UNRESTRICTED 30 /* for peer-to-peer apps */
#else
#include <sys/time.h>
@@ -57,7 +61,6 @@
#include <unistd.h>
#define KVI_INVALID_SOCKET (-1)
-
#endif
#ifndef MSG_NOSIGNAL
diff --git a/src/modules/ident/libkviident.cpp b/src/modules/ident/libkviident.cpp
index 3d4f26ddb..9050bfa56 100644
--- a/src/modules/ident/libkviident.cpp
+++ b/src/modules/ident/libkviident.cpp
@@ -271,6 +271,15 @@ void KviIdentDaemon::run()
goto ipv6_failure;
}
+ #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
+ // under windows, we need to set the socket to be reachable from the outer internet
+ // see bug ticket #393
+ if(!kvi_socket_setsockopt(m_sock6,KVI_SOCKET_PF_INET6,KVI_IPV6_PROTECTION_LEVEL,&(int){ KVI_PROTECTION_LEVEL_UNRESTRICTED }, sizeof(int))
+ {
+ //this is not a fatal error
+ postMessage(__tr("Can't set the IPv6 ident service protection level to unrestricted: the ident service won't be exposed to the internet"),0);
+ }
+ #endif
if(!sa6.socketAddress())
{
postMessage(__tr("Can't enable the ident service on IPv6 : can't setup the listen address"),0);