aboutsummaryrefslogtreecommitdiff
path: root/src/exit
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-05-24 09:35:37 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-05-24 09:35:37 +0000
commit101f5787ac60dafa175950fb714c6d4cc4906478 (patch)
tree711c8042c8b22856b0946d0c819a3520498ac274 /src/exit
parent6743123dcc6b37dabf2759f384a7f6ad08a08bec (diff)
downloadgnunet-101f5787ac60dafa175950fb714c6d4cc4906478.tar.gz
gnunet-101f5787ac60dafa175950fb714c6d4cc4906478.zip
- adding return value to mst callback
Diffstat (limited to 'src/exit')
-rw-r--r--src/exit/gnunet-daemon-exit.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index e58611cc6..26f3e7536 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -953,7 +953,7 @@ tcp_from_helper (const struct GNUNET_TUN_TcpHeader *tcp,
953 * @param client unsued 953 * @param client unsued
954 * @param message message received from helper 954 * @param message message received from helper
955 */ 955 */
956static void 956static int
957message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED, 957message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
958 const struct GNUNET_MessageHeader *message) 958 const struct GNUNET_MessageHeader *message)
959{ 959{
@@ -970,13 +970,13 @@ message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
970 if (ntohs (message->type) != GNUNET_MESSAGE_TYPE_VPN_HELPER) 970 if (ntohs (message->type) != GNUNET_MESSAGE_TYPE_VPN_HELPER)
971 { 971 {
972 GNUNET_break (0); 972 GNUNET_break (0);
973 return; 973 return GNUNET_OK;
974 } 974 }
975 size = ntohs (message->size); 975 size = ntohs (message->size);
976 if (size < sizeof (struct GNUNET_TUN_Layer2PacketHeader) + sizeof (struct GNUNET_MessageHeader)) 976 if (size < sizeof (struct GNUNET_TUN_Layer2PacketHeader) + sizeof (struct GNUNET_MessageHeader))
977 { 977 {
978 GNUNET_break (0); 978 GNUNET_break (0);
979 return; 979 return GNUNET_OK;
980 } 980 }
981 GNUNET_STATISTICS_update (stats, 981 GNUNET_STATISTICS_update (stats,
982 gettext_noop ("# Bytes received from TUN"), 982 gettext_noop ("# Bytes received from TUN"),
@@ -993,20 +993,20 @@ message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
993 { 993 {
994 /* Kernel to blame? */ 994 /* Kernel to blame? */
995 GNUNET_break (0); 995 GNUNET_break (0);
996 return; 996 return GNUNET_OK;
997 } 997 }
998 pkt4 = (const struct GNUNET_TUN_IPv4Header *) &pkt_tun[1]; 998 pkt4 = (const struct GNUNET_TUN_IPv4Header *) &pkt_tun[1];
999 if (size != ntohs (pkt4->total_length)) 999 if (size != ntohs (pkt4->total_length))
1000 { 1000 {
1001 /* Kernel to blame? */ 1001 /* Kernel to blame? */
1002 GNUNET_break (0); 1002 GNUNET_break (0);
1003 return; 1003 return GNUNET_OK;
1004 } 1004 }
1005 if (pkt4->header_length * 4 != sizeof (struct GNUNET_TUN_IPv4Header)) 1005 if (pkt4->header_length * 4 != sizeof (struct GNUNET_TUN_IPv4Header))
1006 { 1006 {
1007 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1007 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1008 _("IPv4 packet options received. Ignored.\n")); 1008 _("IPv4 packet options received. Ignored.\n"));
1009 return; 1009 return GNUNET_OK;
1010 } 1010 }
1011 1011
1012 size -= sizeof (struct GNUNET_TUN_IPv4Header); 1012 size -= sizeof (struct GNUNET_TUN_IPv4Header);
@@ -1034,7 +1034,7 @@ message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
1034 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1034 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1035 _("IPv4 packet with unsupported next header %u received. Ignored.\n"), 1035 _("IPv4 packet with unsupported next header %u received. Ignored.\n"),
1036 (int) pkt4->protocol); 1036 (int) pkt4->protocol);
1037 return; 1037 return GNUNET_OK;
1038 } 1038 }
1039 } 1039 }
1040 break; 1040 break;
@@ -1046,14 +1046,14 @@ message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
1046 { 1046 {
1047 /* Kernel to blame? */ 1047 /* Kernel to blame? */
1048 GNUNET_break (0); 1048 GNUNET_break (0);
1049 return; 1049 return GNUNET_OK;
1050 } 1050 }
1051 pkt6 = (struct GNUNET_TUN_IPv6Header *) &pkt_tun[1]; 1051 pkt6 = (struct GNUNET_TUN_IPv6Header *) &pkt_tun[1];
1052 if (size != ntohs (pkt6->payload_length) + sizeof (struct GNUNET_TUN_IPv6Header)) 1052 if (size != ntohs (pkt6->payload_length) + sizeof (struct GNUNET_TUN_IPv6Header))
1053 { 1053 {
1054 /* Kernel to blame? */ 1054 /* Kernel to blame? */
1055 GNUNET_break (0); 1055 GNUNET_break (0);
1056 return; 1056 return GNUNET_OK;
1057 } 1057 }
1058 size -= sizeof (struct GNUNET_TUN_IPv6Header); 1058 size -= sizeof (struct GNUNET_TUN_IPv6Header);
1059 switch (pkt6->next_header) 1059 switch (pkt6->next_header)
@@ -1080,7 +1080,7 @@ message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
1080 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1080 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1081 _("IPv6 packet with unsupported next header %d received. Ignored.\n"), 1081 _("IPv6 packet with unsupported next header %d received. Ignored.\n"),
1082 pkt6->next_header); 1082 pkt6->next_header);
1083 return; 1083 return GNUNET_OK;
1084 } 1084 }
1085 } 1085 }
1086 break; 1086 break;
@@ -1090,6 +1090,7 @@ message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
1090 ntohs (pkt_tun->proto)); 1090 ntohs (pkt_tun->proto));
1091 break; 1091 break;
1092 } 1092 }
1093 return GNUNET_OK;
1093} 1094}
1094 1095
1095 1096