aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/soft-interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/soft-interface.c')
-rw-r--r--net/batman-adv/soft-interface.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 994b2b8d7e10..0658781febde 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -1,5 +1,4 @@
1/* 1/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
2 * Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
3 * 2 *
4 * Marek Lindner, Simon Wunderlich 3 * Marek Lindner, Simon Wunderlich
5 * 4 *
@@ -16,7 +15,6 @@
16 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA 17 * 02110-1301, USA
19 *
20 */ 18 */
21 19
22#include "main.h" 20#include "main.h"
@@ -65,8 +63,7 @@ int batadv_skb_head_push(struct sk_buff *skb, unsigned int len)
65{ 63{
66 int result; 64 int result;
67 65
68 /** 66 /* TODO: We must check if we can release all references to non-payload
69 * TODO: We must check if we can release all references to non-payload
70 * data using skb_header_release in our skbs to allow skb_cow_header to 67 * data using skb_header_release in our skbs to allow skb_cow_header to
71 * work optimally. This means that those skbs are not allowed to read 68 * work optimally. This means that those skbs are not allowed to read
72 * or write any data which is before the current position of skb->data 69 * or write any data which is before the current position of skb->data
@@ -180,14 +177,16 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
180 switch (atomic_read(&bat_priv->gw_mode)) { 177 switch (atomic_read(&bat_priv->gw_mode)) {
181 case GW_MODE_SERVER: 178 case GW_MODE_SERVER:
182 /* gateway servers should not send dhcp 179 /* gateway servers should not send dhcp
183 * requests into the mesh */ 180 * requests into the mesh
181 */
184 ret = batadv_gw_is_dhcp_target(skb, &header_len); 182 ret = batadv_gw_is_dhcp_target(skb, &header_len);
185 if (ret) 183 if (ret)
186 goto dropped; 184 goto dropped;
187 break; 185 break;
188 case GW_MODE_CLIENT: 186 case GW_MODE_CLIENT:
189 /* gateway clients should send dhcp requests 187 /* gateway clients should send dhcp requests
190 * via unicast to their gateway */ 188 * via unicast to their gateway
189 */
191 ret = batadv_gw_is_dhcp_target(skb, &header_len); 190 ret = batadv_gw_is_dhcp_target(skb, &header_len);
192 if (ret) 191 if (ret)
193 do_bcast = false; 192 do_bcast = false;
@@ -215,7 +214,8 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
215 bcast_packet->header.packet_type = BAT_BCAST; 214 bcast_packet->header.packet_type = BAT_BCAST;
216 215
217 /* hw address of first interface is the orig mac because only 216 /* hw address of first interface is the orig mac because only
218 * this mac is known throughout the mesh */ 217 * this mac is known throughout the mesh
218 */
219 memcpy(bcast_packet->orig, 219 memcpy(bcast_packet->orig,
220 primary_if->net_dev->dev_addr, ETH_ALEN); 220 primary_if->net_dev->dev_addr, ETH_ALEN);
221 221
@@ -226,7 +226,8 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
226 batadv_add_bcast_packet_to_list(bat_priv, skb, 1); 226 batadv_add_bcast_packet_to_list(bat_priv, skb, 1);
227 227
228 /* a copy is stored in the bcast list, therefore removing 228 /* a copy is stored in the bcast list, therefore removing
229 * the original skb. */ 229 * the original skb.
230 */
230 kfree_skb(skb); 231 kfree_skb(skb);
231 232
232 /* unicast packet */ 233 /* unicast packet */
@@ -294,9 +295,10 @@ void batadv_interface_rx(struct net_device *soft_iface,
294 295
295 /* should not be necessary anymore as we use skb_pull_rcsum() 296 /* should not be necessary anymore as we use skb_pull_rcsum()
296 * TODO: please verify this and remove this TODO 297 * TODO: please verify this and remove this TODO
297 * -- Dec 21st 2009, Simon Wunderlich */ 298 * -- Dec 21st 2009, Simon Wunderlich
299 */
298 300
299/* skb->ip_summed = CHECKSUM_UNNECESSARY;*/ 301 /* skb->ip_summed = CHECKSUM_UNNECESSARY; */
300 302
301 bat_priv->stats.rx_packets++; 303 bat_priv->stats.rx_packets++;
302 bat_priv->stats.rx_bytes += skb->len + ETH_HLEN; 304 bat_priv->stats.rx_bytes += skb->len + ETH_HLEN;
@@ -341,8 +343,7 @@ static void interface_setup(struct net_device *dev)
341 dev->destructor = free_netdev; 343 dev->destructor = free_netdev;
342 dev->tx_queue_len = 0; 344 dev->tx_queue_len = 0;
343 345
344 /** 346 /* can't call min_mtu, because the needed variables
345 * can't call min_mtu, because the needed variables
346 * have not been initialized yet 347 * have not been initialized yet
347 */ 348 */
348 dev->mtu = ETH_DATA_LEN; 349 dev->mtu = ETH_DATA_LEN;