Thread (19 messages) 19 messages, 1 author, 2006-10-18
STALE7196d
Revisions (7)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 current
  4. v1 [diff vs current]
  5. v1 [diff vs current]
  6. v1 [diff vs current]
  7. v1 [diff vs current]

[PATCH 10/18] d80211: Fix overflow when creating AVS header

From: Jiri Benc <hidden>
Date: 2006-10-18 15:49:04
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: David Kimdon <redacted>

Fix overflow when converting timespec to microseconds.  Without this patch you
can get an overflow during the multiplication which can result in a negative number.
hostime is define here:

4.4 hosttime
The hosttime field is set to the current value of the host maintained
clock variable when the frame is received.

(from http://www.locustworld.com/tracker/getfile/prism2drivers/doc/capturefrm.txt)

it is a u64.

Signed-off-by: David Kimdon <redacted>
Signed-off-by: Jiri Benc <redacted>

---

 net/d80211/ieee80211.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

4fdbfdf950c3260f16bad12bb1a5ebeac97bee37
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index ce56fd3..6847610 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -2579,7 +2579,7 @@ ieee80211_rx_mgmt(struct net_device *dev
 		struct ieee80211_rate *rate;
 
                 jiffies_to_timespec(status->hosttime, &ts);
-		fi->hosttime = cpu_to_be64(ts.tv_sec * 1000000 +
+		fi->hosttime = cpu_to_be64((u64) ts.tv_sec * 1000000 +
 					   ts.tv_nsec / 1000);
 		fi->mactime = cpu_to_be64(status->mactime);
 		switch (status->phymode) {
-- 
1.3.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help