netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Kimdon <david.kimdon@devicescape.com>
To: netdev@vger.kernel.org
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Jiri Benc <jbenc@suse.cz>,
	David Kimdon <david.kimdon@devicescape.com>
Subject: [patch 1/5] d80211: Fix overflow when creating AVS header
Date: Tue, 3 Oct 2006 11:12:11 -0700	[thread overview]
Message-ID: <20061003181211.GA19403@devicescape.com> (raw)
In-Reply-To: 20061003181118.537800000@devicescape.com

[-- Attachment #1: hosttime.patch --]
[-- Type: text/plain, Size: 1048 bytes --]

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 <david.kimdon@devicescape.com>

Index: wireless-dev/net/d80211/ieee80211.c
===================================================================
--- wireless-dev.orig/net/d80211/ieee80211.c
+++ wireless-dev/net/d80211/ieee80211.c
@@ -2573,7 +2573,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) {

--

       reply	other threads:[~2006-10-03 18:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20061003181118.537800000@devicescape.com>
2006-10-03 18:12 ` David Kimdon [this message]
2006-10-03 18:12 ` [patch 2/5] d80211: remove unused xr structure members, interface, etc David Kimdon
2006-10-03 18:12 ` [patch 3/5] d80211: remove rate limit code David Kimdon
2006-10-03 18:12 ` [patch 4/5] d80211: retain PS frames for at least STA listen interval David Kimdon
2006-10-03 18:12 ` [patch 5/5] d80211: allow wireless vlan interface to have same MAC an AP interface David Kimdon
2006-10-04 16:47   ` Jiri Benc
2006-10-08 21:32   ` Johannes Berg
2006-10-09 21:38     ` [patch 5/5] d80211: allow wireless vlan interface to have sameMAC " Jouni Malinen
2006-10-09 21:49       ` Johannes Berg
2006-10-10 10:50       ` Johannes Berg
2006-10-10 13:42         ` [patch 5/5] d80211: allow wireless vlan interface to havesameMAC " David Kimdon
2006-10-10 13:47           ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061003181211.GA19403@devicescape.com \
    --to=david.kimdon@devicescape.com \
    --cc=jbenc@suse.cz \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).