diff options
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index c7029a579..bf5411d59 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -355,7 +355,7 @@ struct Sessionqueue | |||
355 | struct Sessionqueue *prev; | 355 | struct Sessionqueue *prev; |
356 | struct Session *content; | 356 | struct Session *content; |
357 | #if !HAVE_UNALIGNED_64_ACCESS | 357 | #if !HAVE_UNALIGNED_64_ACCESS |
358 | void *dummy; /* for alignment, see #1909 */ | 358 | void *dummy; /* for alignment, see #1909 */ |
359 | #endif | 359 | #endif |
360 | }; | 360 | }; |
361 | 361 | ||
@@ -1066,8 +1066,9 @@ set_next_send (struct Plugin *const plugin) | |||
1066 | struct GNUNET_TIME_Relative next_send; | 1066 | struct GNUNET_TIME_Relative next_send; |
1067 | 1067 | ||
1068 | //abort if helper is not running | 1068 | //abort if helper is not running |
1069 | if (plugin->helper_is_running == GNUNET_NO){ | 1069 | if (plugin->helper_is_running == GNUNET_NO) |
1070 | return; | 1070 | { |
1071 | return; | ||
1071 | } | 1072 | } |
1072 | 1073 | ||
1073 | //cancel old task | 1074 | //cancel old task |
@@ -1465,12 +1466,13 @@ wlan_transport_start_wlan_helper (struct Plugin *plugin) | |||
1465 | const char *filenameloopback = "gnunet-transport-wlan-helper-dummy"; | 1466 | const char *filenameloopback = "gnunet-transport-wlan-helper-dummy"; |
1466 | char *absolute_filename = NULL; | 1467 | char *absolute_filename = NULL; |
1467 | 1468 | ||
1468 | if (plugin->helper_is_running == GNUNET_YES){ | 1469 | if (plugin->helper_is_running == GNUNET_YES) |
1470 | { | ||
1469 | #if DEBUG_wlan | 1471 | #if DEBUG_wlan |
1470 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, | 1472 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, |
1471 | "wlan_transport_start_wlan_helper not needed, helper already running!"); | 1473 | "wlan_transport_start_wlan_helper not needed, helper already running!"); |
1472 | #endif | 1474 | #endif |
1473 | return GNUNET_YES; | 1475 | return GNUNET_YES; |
1474 | } | 1476 | } |
1475 | 1477 | ||
1476 | plugin->server_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_NO, GNUNET_YES); | 1478 | plugin->server_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_NO, GNUNET_YES); |
@@ -1634,12 +1636,13 @@ wlan_transport_stop_wlan_helper (struct Plugin *plugin) | |||
1634 | "Stoping WLAN helper process\n"); | 1636 | "Stoping WLAN helper process\n"); |
1635 | #endif | 1637 | #endif |
1636 | 1638 | ||
1637 | if (plugin->helper_is_running == GNUNET_NO){ | 1639 | if (plugin->helper_is_running == GNUNET_NO) |
1640 | { | ||
1638 | #if DEBUG_wlan | 1641 | #if DEBUG_wlan |
1639 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, | 1642 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, |
1640 | "wlan_transport_stop_wlan_helper not needed, helper already stopped!"); | 1643 | "wlan_transport_stop_wlan_helper not needed, helper already stopped!"); |
1641 | #endif | 1644 | #endif |
1642 | return GNUNET_YES; | 1645 | return GNUNET_YES; |
1643 | } | 1646 | } |
1644 | 1647 | ||
1645 | if (plugin->server_write_delay_task != GNUNET_SCHEDULER_NO_TASK) | 1648 | if (plugin->server_write_delay_task != GNUNET_SCHEDULER_NO_TASK) |
@@ -2604,13 +2607,15 @@ wlan_data_message_handler (void *cls, const struct GNUNET_MessageHeader *hdr) | |||
2604 | temp_hdr = (const struct GNUNET_MessageHeader *) &wlanheader[1]; | 2607 | temp_hdr = (const struct GNUNET_MessageHeader *) &wlanheader[1]; |
2605 | crc = ntohl (wlanheader->crc); | 2608 | crc = ntohl (wlanheader->crc); |
2606 | wlanheader->crc = 0; | 2609 | wlanheader->crc = 0; |
2607 | if (GNUNET_CRYPTO_crc32_n ((char *) wlanheader, ntohs (wlanheader->header.size)) != crc) | 2610 | if (GNUNET_CRYPTO_crc32_n |
2611 | ((char *) wlanheader, ntohs (wlanheader->header.size)) != crc) | ||
2608 | { | 2612 | { |
2609 | //wrong crc, dispose message | 2613 | //wrong crc, dispose message |
2610 | GNUNET_log_from (GNUNET_ERROR_TYPE_INFO, PLUGIN_LOG_NAME, | 2614 | GNUNET_log_from (GNUNET_ERROR_TYPE_INFO, PLUGIN_LOG_NAME, |
2611 | "Wlan message header crc was wrong: %u != %u\n", | 2615 | "Wlan message header crc was wrong: %u != %u\n", |
2612 | GNUNET_CRYPTO_crc32_n ((char *) wlanheader, | 2616 | GNUNET_CRYPTO_crc32_n ((char *) wlanheader, |
2613 | ntohs (wlanheader->header.size)), crc); | 2617 | ntohs (wlanheader->header.size)), |
2618 | crc); | ||
2614 | hexdump ((void *) hdr, ntohs (hdr->size)); | 2619 | hexdump ((void *) hdr, ntohs (hdr->size)); |
2615 | return; | 2620 | return; |
2616 | } | 2621 | } |