From c9cc0e7dee3eb90bdf12940f6a95f6abd99c55e8 Mon Sep 17 00:00:00 2001 From: mentor Date: Tue, 5 Feb 2008 06:22:32 +0000 Subject: [PATCH] Correct pointer arithmetic in the SKB CB. With thanks (but not copyright ;) to Alessandro Erta git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3337 0192ed92-7a03-0410-a25b-9323aeb14dbd --- THANKS | 1 + ath/if_ath.c | 2 +- net80211/ieee80211_monitor.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/THANKS b/THANKS index a79b360..56448ea 100644 --- a/THANKS +++ b/THANKS @@ -129,6 +129,7 @@ Derek J Smithies jhansen Benoit Papillault Russell Harmon +Alessandro Erta Apologies to anyone whose name was unintentionally left off. Please let us know if you think your name should be mentioned here! diff --git a/ath/if_ath.c b/ath/if_ath.c index 2df32d6..a7ddd91 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -2859,7 +2859,7 @@ ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb) struct ath_softc *sc = dev->priv; struct ath_hal *ah = sc->sc_ah; struct ieee80211_phy_params *ph = (struct ieee80211_phy_params *) - (SKB_CB(skb) + sizeof(struct ieee80211_cb)); + (SKB_CB(skb) + 1); /* NB: SKB_CB casts to CB struct*. */ const HAL_RATE_TABLE *rt; unsigned int pktlen, hdrlen, try0, power; HAL_PKT_TYPE atype; diff --git a/net80211/ieee80211_monitor.c b/net80211/ieee80211_monitor.c index ff52576..ee42d4e 100644 --- a/net80211/ieee80211_monitor.c +++ b/net80211/ieee80211_monitor.c @@ -128,8 +128,8 @@ struct ar5212_openbsd_desc { void ieee80211_monitor_encap(struct ieee80211vap *vap, struct sk_buff *skb) { - struct ieee80211_phy_params *ph = - (struct ieee80211_phy_params *) (SKB_CB(skb) + sizeof(struct ieee80211_cb)); + struct ieee80211_phy_params *ph = (struct ieee80211_phy_params *) + (SKB_CB(skb) + 1); /* NB: SKB_CB casts to CB struct*. */ SKB_CB(skb)->flags = M_RAW; SKB_CB(skb)->ni = NULL; SKB_CB(skb)->next = NULL; -- 2.35.1