diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-14 15:02:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-14 15:02:53 +0000 |
commit | 09923f6cb3e8ff97586824c57f34d7d38e0c0986 (patch) | |
tree | 66ade3702ca8500100acfa05b139cd463d456fee /src/transport/gnunet-helper-transport-wlan-dummy.c | |
parent | f326fb85c52d9b7c13023c98795674c379269349 (diff) | |
download | gnunet-09923f6cb3e8ff97586824c57f34d7d38e0c0986.tar.gz gnunet-09923f6cb3e8ff97586824c57f34d7d38e0c0986.zip |
-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.c | 19 |
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) | |||
72 | return sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage); | 72 | return sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage); |
73 | } | 73 | } |
74 | 74 | ||
75 | |||
75 | static void | 76 | static void |
76 | stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | 77 | stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) |
77 | { | 78 | { |
@@ -83,8 +84,9 @@ stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
83 | char *to_start; | 84 | char *to_start; |
84 | 85 | ||
85 | sendsize = | 86 | sendsize = |
86 | ntohs (hdr->size) - sizeof (struct Radiotap_Send) + | 87 | ntohs (hdr->size) - sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) + |
87 | sizeof (struct Radiotap_rx); | 88 | sizeof (struct Radiotap_rx) + sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame) + |
89 | sizeof (struct GNUNET_MessageHeader); | ||
88 | 90 | ||
89 | if (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs (hdr->type)) | 91 | if (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs (hdr->type)) |
90 | { | 92 | { |
@@ -110,13 +112,14 @@ stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
110 | 112 | ||
111 | to_data = to_radiotap + sizeof (struct Radiotap_rx); | 113 | to_data = to_radiotap + sizeof (struct Radiotap_rx); |
112 | memcpy (to_data, | 114 | memcpy (to_data, |
113 | ((char *) hdr) + sizeof (struct Radiotap_Send) + | 115 | ((char *) hdr) + |
114 | sizeof (struct GNUNET_MessageHeader), | 116 | sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) - |
115 | ntohs (hdr->size) - sizeof (struct Radiotap_Send) - | 117 | - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame), |
116 | sizeof (struct GNUNET_MessageHeader)); | 118 | ntohs (hdr->size) - (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) |
119 | - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame))); | ||
117 | write_pout->size += | 120 | write_pout->size += |
118 | ntohs (hdr->size) - sizeof (struct Radiotap_Send) - | 121 | ntohs (hdr->size) - (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) |
119 | sizeof (struct GNUNET_MessageHeader); | 122 | - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame)); |
120 | } | 123 | } |
121 | 124 | ||
122 | 125 | ||