aboutsummaryrefslogtreecommitdiff
path: root/src/vpn/gnunet-service-vpn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpn/gnunet-service-vpn.c')
-rw-r--r--src/vpn/gnunet-service-vpn.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c
index aa0ea51a3..d9daaa7e2 100644
--- a/src/vpn/gnunet-service-vpn.c
+++ b/src/vpn/gnunet-service-vpn.c
@@ -1384,7 +1384,7 @@ create_channel (struct ChannelState *ts,
1384 GNUNET_MQ_handler_end() 1384 GNUNET_MQ_handler_end()
1385 }; 1385 };
1386 1386
1387 return GNUNET_CADET_channel_creatE (cadet_handle, 1387 return GNUNET_CADET_channel_create (cadet_handle,
1388 ts, 1388 ts,
1389 target, 1389 target,
1390 port, 1390 port,
@@ -1839,7 +1839,7 @@ route_packet (struct DestinationEntry *destination,
1839 1839
1840 mlen = sizeof (struct GNUNET_EXIT_UdpServiceMessage) + 1840 mlen = sizeof (struct GNUNET_EXIT_UdpServiceMessage) +
1841 payload_length - sizeof (struct GNUNET_TUN_UdpHeader); 1841 payload_length - sizeof (struct GNUNET_TUN_UdpHeader);
1842 if (mlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 1842 if (mlen >= GNUNET_MAX_MESSAGE_SIZE)
1843 { 1843 {
1844 GNUNET_break (0); 1844 GNUNET_break (0);
1845 return; 1845 return;
@@ -1864,7 +1864,7 @@ route_packet (struct DestinationEntry *destination,
1864 1864
1865 mlen = sizeof (struct GNUNET_EXIT_UdpInternetMessage) + 1865 mlen = sizeof (struct GNUNET_EXIT_UdpInternetMessage) +
1866 alen + payload_length - sizeof (struct GNUNET_TUN_UdpHeader); 1866 alen + payload_length - sizeof (struct GNUNET_TUN_UdpHeader);
1867 if (mlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 1867 if (mlen >= GNUNET_MAX_MESSAGE_SIZE)
1868 { 1868 {
1869 GNUNET_break (0); 1869 GNUNET_break (0);
1870 return; 1870 return;
@@ -1904,7 +1904,7 @@ route_packet (struct DestinationEntry *destination,
1904 1904
1905 mlen = sizeof (struct GNUNET_EXIT_TcpServiceStartMessage) + 1905 mlen = sizeof (struct GNUNET_EXIT_TcpServiceStartMessage) +
1906 payload_length - sizeof (struct GNUNET_TUN_TcpHeader); 1906 payload_length - sizeof (struct GNUNET_TUN_TcpHeader);
1907 if (mlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 1907 if (mlen >= GNUNET_MAX_MESSAGE_SIZE)
1908 { 1908 {
1909 GNUNET_break (0); 1909 GNUNET_break (0);
1910 return; 1910 return;
@@ -1927,7 +1927,7 @@ route_packet (struct DestinationEntry *destination,
1927 1927
1928 mlen = sizeof (struct GNUNET_EXIT_TcpInternetStartMessage) + 1928 mlen = sizeof (struct GNUNET_EXIT_TcpInternetStartMessage) +
1929 alen + payload_length - sizeof (struct GNUNET_TUN_TcpHeader); 1929 alen + payload_length - sizeof (struct GNUNET_TUN_TcpHeader);
1930 if (mlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 1930 if (mlen >= GNUNET_MAX_MESSAGE_SIZE)
1931 { 1931 {
1932 GNUNET_break (0); 1932 GNUNET_break (0);
1933 return; 1933 return;
@@ -1963,7 +1963,7 @@ route_packet (struct DestinationEntry *destination,
1963 1963
1964 mlen = sizeof (struct GNUNET_EXIT_TcpDataMessage) + 1964 mlen = sizeof (struct GNUNET_EXIT_TcpDataMessage) +
1965 payload_length - sizeof (struct GNUNET_TUN_TcpHeader); 1965 payload_length - sizeof (struct GNUNET_TUN_TcpHeader);
1966 if (mlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 1966 if (mlen >= GNUNET_MAX_MESSAGE_SIZE)
1967 { 1967 {
1968 GNUNET_break (0); 1968 GNUNET_break (0);
1969 return; 1969 return;
@@ -2038,7 +2038,7 @@ route_packet (struct DestinationEntry *destination,
2038 /* update length calculations, as payload_length may have changed */ 2038 /* update length calculations, as payload_length may have changed */
2039 mlen = sizeof (struct GNUNET_EXIT_IcmpServiceMessage) + 2039 mlen = sizeof (struct GNUNET_EXIT_IcmpServiceMessage) +
2040 alen + payload_length - sizeof (struct GNUNET_TUN_IcmpHeader); 2040 alen + payload_length - sizeof (struct GNUNET_TUN_IcmpHeader);
2041 if (mlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 2041 if (mlen >= GNUNET_MAX_MESSAGE_SIZE)
2042 { 2042 {
2043 GNUNET_break (0); 2043 GNUNET_break (0);
2044 return; 2044 return;
@@ -2061,6 +2061,7 @@ route_packet (struct DestinationEntry *destination,
2061 void *payload; 2061 void *payload;
2062 uint8_t new_type; 2062 uint8_t new_type;
2063 2063
2064 new_type = icmp->type;
2064 /* Perform ICMP protocol-translation (depending on destination AF and source AF) 2065 /* Perform ICMP protocol-translation (depending on destination AF and source AF)
2065 and throw away ICMP payload depending on ICMP message type */ 2066 and throw away ICMP payload depending on ICMP message type */
2066 switch (af) 2067 switch (af)
@@ -2111,8 +2112,8 @@ route_packet (struct DestinationEntry *destination,
2111 switch (icmp->type) 2112 switch (icmp->type)
2112 { 2113 {
2113 case GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE: 2114 case GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE:
2114 if (destination->details.exit_destination.af == AF_INET6) 2115 if (destination->details.exit_destination.af == AF_INET)
2115 new_type = GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE; 2116 new_type = GNUNET_TUN_ICMPTYPE_DESTINATION_UNREACHABLE;
2116 /* throw away IP-payload, exit will have to make it up anyway */ 2117 /* throw away IP-payload, exit will have to make it up anyway */
2117 payload_length = sizeof (struct GNUNET_TUN_IcmpHeader); 2118 payload_length = sizeof (struct GNUNET_TUN_IcmpHeader);
2118 break; 2119 break;
@@ -2167,7 +2168,7 @@ route_packet (struct DestinationEntry *destination,
2167 /* update length calculations, as payload_length may have changed */ 2168 /* update length calculations, as payload_length may have changed */
2168 mlen = sizeof (struct GNUNET_EXIT_IcmpInternetMessage) + 2169 mlen = sizeof (struct GNUNET_EXIT_IcmpInternetMessage) +
2169 alen + payload_length - sizeof (struct GNUNET_TUN_IcmpHeader); 2170 alen + payload_length - sizeof (struct GNUNET_TUN_IcmpHeader);
2170 if (mlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 2171 if (mlen >= GNUNET_MAX_MESSAGE_SIZE)
2171 { 2172 {
2172 GNUNET_break (0); 2173 GNUNET_break (0);
2173 return; 2174 return;
@@ -2216,12 +2217,10 @@ route_packet (struct DestinationEntry *destination,
2216 * and forward the packet. 2217 * and forward the packet.
2217 * 2218 *
2218 * @param cls closure, NULL 2219 * @param cls closure, NULL
2219 * @param client NULL
2220 * @param message message we got from the client (VPN channel interface) 2220 * @param message message we got from the client (VPN channel interface)
2221 */ 2221 */
2222static int 2222static int
2223message_token (void *cls, 2223message_token (void *cls,
2224 void *client,
2225 const struct GNUNET_MessageHeader *message) 2224 const struct GNUNET_MessageHeader *message)
2226{ 2225{
2227 const struct GNUNET_TUN_Layer2PacketHeader *tun; 2226 const struct GNUNET_TUN_Layer2PacketHeader *tun;
@@ -3067,7 +3066,7 @@ run (void *cls,
3067 } 3066 }
3068 vpn_argv[6] = NULL; 3067 vpn_argv[6] = NULL;
3069 3068
3070 cadet_handle = GNUNET_CADET_connecT (cfg_); 3069 cadet_handle = GNUNET_CADET_connect (cfg_);
3071 // FIXME never opens ports??? 3070 // FIXME never opens ports???
3072 helper_handle = GNUNET_HELPER_start (GNUNET_NO, 3071 helper_handle = GNUNET_HELPER_start (GNUNET_NO,
3073 "gnunet-helper-vpn", vpn_argv, 3072 "gnunet-helper-vpn", vpn_argv,