Subject: Re: [Bugme-new] [Bug 11144] New: dhcp doesn't work with iwl4965

From: Patrick McHardy <[email-masked]>
Date: Wed, 23 Jul 2008 17:18:48 +0200

François Valenduc wrote:
> I did the bisection again, this time on the whole tree and the first bad 
> commit is again the one I mentioned previously:
> 
> 175f9c1bba9b825d22b142d183c9e175488b260c is first bad commit
> commit 175f9c1bba9b825d22b142d183c9e175488b260c
> Author: Jussi Kivilinna <[email-masked]>
> Date:   Sun Jul 20 00:08:47 2008 -0700
> 
>    net_sched: Add size table for qdiscs
> 
>    Add size table functions for qdiscs and calculate packet size in
>    qdisc_enqueue().
> 
>    Based on patch by Patrick McHardy
>     http://marc.info/?l=linux-netdev&m=115201979221729&w=2
> 
> This time, I didn't encounter kernels which didn't compile. So, I didn't 
> use git-reset or git-bisect skip.

I think I know whats happening (Jussi CCed). That commit introduced
a qdisc_skb_cb, which conflicts with the mac80211 usage of skb->cb.
mac80211 seems to expect the CB to survive the qdisc layer, which
is wrong. One possibility to fix this (or just test my theory)
would be to make sure they don't clash by adding the struct
ieee80211_tx_info to qdisc_skb_cb->data. Something like this patch.

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 4dd3d93..e19815e 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -19,6 +19,7 @@
 #include <linux/wireless.h>
 #include <linux/device.h>
 #include <linux/ieee80211.h>
+#include <net/sched_generic.h>
 #include <net/wireless.h>
 #include <net/cfg80211.h>
 
@@ -343,7 +344,10 @@ struct ieee80211_tx_info {
 
 static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
 {
-	return (struct ieee80211_tx_info *)skb->cb;
+	BUILD_BUG_ON(sizeof(skb->cb) <
+		     sizeof(struct qdisc_skb_cb) +
+		     sizeof(struct ieee80211_tx_info));
+	return (struct ieee80211_tx_info *)qdisc_skb_cb(skb)->data;
 }