batman-adv: fix two issues in DAT

Message ID 1321911479-23444-1-git-send-email-siwu@hrz.tu-chemnitz.de (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Simon Wunderlich Nov. 21, 2011, 9:37 p.m. UTC
  * use CONFIG_BATMAN_ADV_DAT instead of CONFIG_BATMAN_ADV_BAT
 * use skb_reset_mac_header() to avoid crashes because of null pointers
   within arp_get_type()

I've reviewed the DAT patchset, all of the previous comments have been
integrated well. It also runs well within my VMs (after applying this
patch).

Please integrate this patch into the previous one and resend it. You
may add my Reviewed-By tag.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
 distributed-arp-table.h |    2 +-
 soft-interface.c        |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
  

Patch

diff --git a/distributed-arp-table.h b/distributed-arp-table.h
index 496b7f3..bd32c89 100644
--- a/distributed-arp-table.h
+++ b/distributed-arp-table.h
@@ -28,7 +28,7 @@ 
 #define ARP_HW_DST(skb) (ARP_HW_SRC(skb) + ETH_ALEN + 4)
 #define ARP_IP_DST(skb) (*(uint32_t *)(ARP_HW_SRC(skb) + ETH_ALEN * 2 + 4))
 
-#ifdef CONFIG_BATMAN_ADV_BAT
+#ifdef CONFIG_BATMAN_ADV_DAT
 
 uint16_t arp_get_type(struct bat_priv *bat_priv, struct sk_buff *skb);
 bool arp_snoop_outgoing_request(struct bat_priv *bat_priv,
diff --git a/soft-interface.c b/soft-interface.c
index 9107b22..786bc71 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -592,6 +592,8 @@  static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
 		goto end;
 	}
 
+	skb_reset_mac_header(skb);
+
 	/**
 	 * if we have a another chosen mesh exit node in range
 	 * it will transport the packets to the mesh