[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r34409 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r34409 - gnunet/src/transport |
Date: |
Sat, 22 Nov 2014 20:02:42 +0100 |
Author: grothoff
Date: 2014-11-22 20:02:42 +0100 (Sat, 22 Nov 2014)
New Revision: 34409
Modified:
gnunet/src/transport/plugin_transport_tcp.c
Log:
adding support for TCP STEALTH integrity protection
Modified: gnunet/src/transport/plugin_transport_tcp.c
===================================================================
--- gnunet/src/transport/plugin_transport_tcp.c 2014-11-22 18:57:36 UTC (rev
34408)
+++ gnunet/src/transport/plugin_transport_tcp.c 2014-11-22 19:02:42 UTC (rev
34409)
@@ -1689,12 +1689,18 @@
}
else
{
- if (GNUNET_OK !=
- GNUNET_NETWORK_socket_setsockopt (s,
- IPPROTO_TCP,
- SO_TCPSTEALTH,
- &session->target,
- sizeof (struct
GNUNET_PeerIdentity)))
+ if ( (GNUNET_OK !=
+ GNUNET_NETWORK_socket_setsockopt (s,
+ IPPROTO_TCP,
+ SO_TCPSTEALTH,
+ &session->target,
+ sizeof (struct
GNUNET_PeerIdentity))) ||
+ (GNUNET_OK !=
+ GNUNET_NETWORK_socket_setsockopt (s,
+ IPPROTO_TCP,
+ SO_TCPSTEALTH_INTEGRITY,
+ &plugin->my_welcome,
+ sizeof (struct WelcomeMessage)))
)
{
/* TCP STEALTH not supported by kernel */
GNUNET_break (GNUNET_OK ==
@@ -2791,14 +2797,22 @@
lsocks = GNUNET_SERVICE_get_listen_sockets (service);
if (NULL != lsocks)
{
+ uint32_t len = sizeof (struct WelcomeMessage);
+
for (i=0;NULL!=lsocks[i];i++)
{
- if (GNUNET_OK !=
- GNUNET_NETWORK_socket_setsockopt (lsocks[i],
- IPPROTO_TCP,
- SO_TCPSTEALTH,
- env->my_identity,
- sizeof (struct
GNUNET_PeerIdentity)))
+ if ( (GNUNET_OK !=
+ GNUNET_NETWORK_socket_setsockopt (lsocks[i],
+ IPPROTO_TCP,
+ SO_TCPSTEALTH,
+ env->my_identity,
+ sizeof (struct
GNUNET_PeerIdentity))) ||
+ (GNUNET_OK !=
+ GNUNET_NETWORK_socket_setsockopt (lsocks[i],
+ IPPROTO_TCP,
+ SO_TCPSTEALTH_INTEGRITY_LEN,
+ &len,
+ sizeof (len))) )
{
/* TCP STEALTH not supported by kernel */
GNUNET_assert (0 == i);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r34409 - gnunet/src/transport,
gnunet <=