summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-helper-transport-wlan-dummy.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-03-14 15:02:53 +0000
committerChristian Grothoff <christian@grothoff.org>2012-03-14 15:02:53 +0000
commit09923f6cb3e8ff97586824c57f34d7d38e0c0986 (patch)
tree66ade3702ca8500100acfa05b139cd463d456fee /src/transport/gnunet-helper-transport-wlan-dummy.c
parentf326fb85c52d9b7c13023c98795674c379269349 (diff)
-fixing some of the issues from #1939 -- untested
Diffstat (limited to 'src/transport/gnunet-helper-transport-wlan-dummy.c')
-rw-r--r--src/transport/gnunet-helper-transport-wlan-dummy.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/transport/gnunet-helper-transport-wlan-dummy.c b/src/transport/gnunet-helper-transport-wlan-dummy.c
index 6fff758c5..3f17b04dd 100644
--- a/src/transport/gnunet-helper-transport-wlan-dummy.c
+++ b/src/transport/gnunet-helper-transport-wlan-dummy.c
@@ -72,6 +72,7 @@ send_mac_to_plugin (char *buffer, struct GNUNET_TRANSPORT_WLAN_MacAddress *mac)
return sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage);
}
+
static void
stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
{
@@ -83,8 +84,9 @@ stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
char *to_start;
sendsize =
- ntohs (hdr->size) - sizeof (struct Radiotap_Send) +
- sizeof (struct Radiotap_rx);
+ ntohs (hdr->size) - sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) +
+ sizeof (struct Radiotap_rx) + sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame) +
+ sizeof (struct GNUNET_MessageHeader);
if (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs (hdr->type))
{
@@ -110,13 +112,14 @@ stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
to_data = to_radiotap + sizeof (struct Radiotap_rx);
memcpy (to_data,
- ((char *) hdr) + sizeof (struct Radiotap_Send) +
- sizeof (struct GNUNET_MessageHeader),
- ntohs (hdr->size) - sizeof (struct Radiotap_Send) -
- sizeof (struct GNUNET_MessageHeader));
+ ((char *) hdr) +
+ sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) -
+ - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame),
+ ntohs (hdr->size) - (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage)
+ - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame)));
write_pout->size +=
- ntohs (hdr->size) - sizeof (struct Radiotap_Send) -
- sizeof (struct GNUNET_MessageHeader);
+ ntohs (hdr->size) - (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage)
+ - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame));
}