From owner-p4-projects@FreeBSD.ORG Sun Oct 12 20:25:17 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4F58316A4C0; Sun, 12 Oct 2003 20:25:17 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2654E16A4B3 for ; Sun, 12 Oct 2003 20:25:17 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66E5B43FB1 for ; Sun, 12 Oct 2003 20:25:16 -0700 (PDT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id h9D3PGXJ084686 for ; Sun, 12 Oct 2003 20:25:16 -0700 (PDT) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id h9D3PFm0084683 for perforce@freebsd.org; Sun, 12 Oct 2003 20:25:15 -0700 (PDT) (envelope-from sam@freebsd.org) Date: Sun, 12 Oct 2003 20:25:15 -0700 (PDT) Message-Id: <200310130325.h9D3PFm0084683@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 39616 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2003 03:25:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=39616 Change 39616 by sam@sam_ebb on 2003/10/12 20:25:14 Reduce per-packet overhead when using WEP by using an advancing IV seeded with arc4random rather than calling arc4random for each packet. Note this is the same algorithm used to select the IV when doing WEP on the host. Affected files ... .. //depot/projects/netperf/sys/dev/ath/if_ath.c#18 edit Differences ... ==== //depot/projects/netperf/sys/dev/ath/if_ath.c#18 (text+ko) ==== @@ -1735,7 +1735,14 @@ * So we use pseudo random IV for now, though it is not the * right way. */ - iv = arc4random(); + iv = ic->ic_iv; + /* + * Skip 'bad' IVs from Fluhrer/Mantin/Shamir: + * (B, 255, N) with 3 <= B < 8 + */ + if (iv >= 0x03ff00 && (iv & 0xf8ff00) == 0x00ff00) + iv += 0x000100; + ic->ic_iv = iv + 1; for (i = 0; i < IEEE80211_WEP_IVLEN; i++) { ivp[i] = iv; iv >>= 8;