aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-helper-transport-wlan-dummy.c
diff options
context:
space:
mode:
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)
72 return sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage); 72 return sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage);
73} 73}
74 74
75
75static void 76static void
76stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) 77stdin_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