Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] Merge __load_pointer() and load_pointer() in net/core/filter.c; kernel 2.6.14
From: Herbert Xu @ 2005-11-03  1:50 UTC (permalink / raw)
  To: Kris Katterjohn; +Cc: jschlst, torvalds, linux-kernel, davem, acme, netdev
In-Reply-To: <e626300280b94e0abc26defcc6043b91.kjak@ispwest.com>

Kris Katterjohn <kjak@ispwest.com> wrote:
> Another patch for net/core/filter.c by me. I merged __load_pointer() into
> load_pointer(). I don't see a point in having two seperate functions when
> both functions are really small and load_pointer() calls __load_pointer().
> Renamed the variable "k" to "offset" since that's what it is, and in
> skb_header_pointer() it's "offset".
> 
> This patch is a diff from kernel 2.6.14

This code path is performance-critical so you should benchmark your
changes.

In this particular case, __load_pointer is the unlikely case and
therefore it wasn't inlined.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [PATCH][MCAST]Two fix for implementation of MLDv2 .
From: Yan Zheng @ 2005-11-03  1:22 UTC (permalink / raw)
  To: Yan Zheng; +Cc: netdev, linux-kernel, David Stevens
In-Reply-To: <436878E7.3030303@21cn.com>

I find something interesting .  Maybe more changes for is_in(...) are needed.


static int is_in(struct ifmcaddr6 *pmc, struct ip6_sf_list *psf, int type,
	int gdeleted, int sdeleted)
{
	switch (type) {
	case MLD2_MODE_IS_INCLUDE:
	case MLD2_CHANGE_TO_INCLUDE:
		if (gdeleted || sdeleted)
			return 0;
		if (psf->sf_count[MCAST_INCLUDE] == 0)
			return 0;    // maybe never happen
		if (type == MLD2_CHANGE_TO_INCLUDE)
			return 1;
		return !((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp);
	case MLD2_MODE_IS_EXCLUDE:
	case MLD2_CHANGE_TO_EXCLUDE:
		if (gdeleted || sdeleted)
			return 0;
		if (pmc->mca_sfcount[MCAST_EXCLUDE] == 0 ||
		    psf->sf_count[MCAST_INCLUDE])
			return 0;
		if (type == MLD2_MODE_IS_EXCLUDE)
			return 1;
		return pmc->mca_sfcount[MCAST_EXCLUDE] ==
			psf->sf_count[MCAST_EXCLUDE];
	case MLD2_ALLOW_NEW_SOURCES:
		if (gdeleted || !psf->sf_crcount)
			return 0;
		return (pmc->mca_sfmode == MCAST_INCLUDE) ^ sdeleted;
	case MLD2_BLOCK_OLD_SOURCES:
		if (pmc->mca_sfmode == MCAST_INCLUDE)
			return gdeleted || (psf->sf_crcount && sdeleted);
		return psf->sf_crcount && !gdeleted && !sdeleted;
	}
	return 0;
}

^ permalink raw reply

* Re: [PATCH]A old patch for addrconf_ifdown(...).
From: Arnaldo Carvalho de Melo @ 2005-11-03  1:14 UTC (permalink / raw)
  To: Yan Zheng; +Cc: netdev, linux-kernel
In-Reply-To: <43695E77.3080707@21cn.com>

On 11/2/05, Yan Zheng <yanzheng@21cn.com> wrote:
> Hi.
>
> The patch may be got lost. It's already acked by YOSHIFUJI.
>
>
> Signed-off-by: Yan Zheng<yanzheng@21cn.com>

I tought it had already been applied by Dave:

http://www.uwsg.iu.edu/hypermail/linux/kernel/0510.1/1290.html

Anyway, applying it now, thanks.

- Arnaldo

^ permalink raw reply

* [PATCH]A old patch for addrconf_ifdown(...).
From: Yan Zheng @ 2005-11-03  0:48 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, Arnaldo Carvalho de Melo

Hi.

The patch may be got lost. It's already acked by YOSHIFUJI.


Signed-off-by: Yan Zheng<yanzheng@21cn.com>

Index:  net/ipv6/addrconf.c
------------------------------------------------------------------------
--- linux-2.6.14/net/ipv6/addrconf.c	2005-10-28 08:02:08.000000000 +0800
+++ linux/net/ipv6/addrconf.c	2005-11-03 08:35:11.000000000 +0800
@@ -2167,7 +2167,7 @@ static int addrconf_ifdown(struct net_de
 
 	/* Step 5: netlink notification of this interface */
 	idev->tstamp = jiffies;
-	inet6_ifinfo_notify(RTM_NEWLINK, idev);
+	inet6_ifinfo_notify(RTM_DELLINK, idev);
 	
 	/* Shot the device (if unregistered) */
 

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Arnaldo Carvalho de Melo @ 2005-11-02 23:28 UTC (permalink / raw)
  To: Yan Zheng; +Cc: netdev, linux-kernel, David Stevens
In-Reply-To: <43694B94.7010605@21cn.com>

On 11/2/05, Yan Zheng <yanzheng@21cn.com> wrote:
> >
> > Could you please compile test it next time :-) hint, missing ';'.
> > Anyway, fixed up by hand.
> >
> > - Arnaldo
> >
> >
>
> I'm so sorry.

Don't worry, I already fixed it and published in my net-2.6.git tree at
www.kernel.org, its just that the same confidence that makes one
commit something simple as in your case could introduce something
nasty :-)

- Arnaldo

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Yan Zheng @ 2005-11-02 23:28 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: netdev, linux-kernel, David Stevens
In-Reply-To: <39e6f6c70511021355i52aff7e4n19ca4c1e24b21bb7@mail.gmail.com>

> 
> Could you please compile test it next time :-) hint, missing ';'.
> Anyway, fixed up by hand.
> 
> - Arnaldo
> 
> 

I'm so sorry. 

============================================================
--- linux-2.6.14/net/ipv4/igmp.c	2005-10-28 08:02:08.000000000 +0800
+++ linux/net/ipv4/igmp.c	2005-11-02 07:31:01.000000000 +0800
@@ -1908,8 +1908,11 @@ int ip_mc_msfilter(struct sock *sk, stru
			sock_kfree_s(sk, newpsl, IP_SFLSIZE(newpsl->sl_max));
			goto done;
		}
-	} else
+	} else {
		newpsl = NULL;
+		(void) ip_mc_add_src(in_dev, &msf->imsf_multiaddr,
+			msf->imsf_fmode, 0, NULL, 0);
+	}
	psl = pmc->sflist;
	if (psl) {
		(void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Arnaldo Carvalho de Melo @ 2005-11-02 21:55 UTC (permalink / raw)
  To: Yan Zheng; +Cc: netdev, linux-kernel, David Stevens
In-Reply-To: <4367FF22.3030601@21cn.com>

On 11/1/05, Yan Zheng <yanzheng@21cn.com> wrote:
> David Stevens wrote:
> > Yan,
> >         Please also make this equivalent change in IPv4 with
> > ip_mc_msfilter() and ip_mc_add_src().
> >
> >                                                 +-DLS
> >
> > Acked-by: David L Stevens <dlstevens@us.ibm.com>
>
> To keep code style, I also create a new patch for IPv6. :-)
>
> Signed-off-by: Yan Zheng <yanzheng@21cn.com>
>
> Patch for IPv4
> Index:net/ipv4/igmp.c
> ============================================================
> --- linux-2.6.14/net/ipv4/igmp.c        2005-10-28 08:02:08.000000000 +0800
> +++ linux/net/ipv4/igmp.c       2005-11-02 07:31:01.000000000 +0800
> @@ -1908,8 +1908,11 @@ int ip_mc_msfilter(struct sock *sk, stru
>                         sock_kfree_s(sk, newpsl, IP_SFLSIZE(newpsl->sl_max));
>                         goto done;
>                 }
> -       } else
> +       } else {
>                 newpsl = NULL;
> +               (void) ip_mc_add_src(in_dev, &msf->imsf_multiaddr,
> +                       msf->imsf_fmode, 0, NULL, 0)

Could you please compile test it next time :-) hint, missing ';'.
Anyway, fixed up by hand.

- Arnaldo

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Arnaldo Carvalho de Melo @ 2005-11-02 21:46 UTC (permalink / raw)
  To: David Stevens
  Cc: Willy Tarreau, David S. Miller, linux-kernel, Marcelo Tosatti,
	netdev, Yan Zheng
In-Reply-To: <OF9D4BE592.A4BBC034-ON882570AD.00608386-882570AD.006143BA@us.ibm.com>

On 11/2/05, David Stevens <dlstevens@us.ibm.com> wrote:
> Willy Tarreau <willy@w.ods.org> wrote on 11/02/2005 01:29:59 AM:
>
> > Marcelo, David, does this backport seem appropriate for 2.4.32 ? I
> verified
> > that it compiles, nothing more.
>
>         Yes.
>
> > If it's OK, I've noticed another patch that
> > Yan posted today and which might be of interest before a very solid
> release.
>
>         I think they should be reviewed first. :-)

Sure thing David, and thanks for your much appreciated review of patches for
the area.

- Arnaldo

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Arnaldo Carvalho de Melo @ 2005-11-02 21:45 UTC (permalink / raw)
  To: David Stevens; +Cc: Yan Zheng, linux-kernel, netdev
In-Reply-To: <OF19AE07D9.BF2B28D4-ON882570AC.0083498D-882570AC.00835D3A@us.ibm.com>

On 11/1/05, David Stevens <dlstevens@us.ibm.com> wrote:
> Looks good. Thanks, Yan.
>
>                         +-DLS

Thanks everybody, Applied.

- Arnaldo

^ permalink raw reply

* [PATCH-2.4][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Willy Tarreau @ 2005-11-02 21:31 UTC (permalink / raw)
  To: Marcelo Tosatti
  Cc: David Stevens, linux-kernel, netdev, Yan Zheng, David S. Miller
In-Reply-To: <20051102134112.GB2609@logos.cnet>

Hi Marcelo,

On Wed, Nov 02, 2005 at 11:41:12AM -0200, Marcelo Tosatti wrote:
> Given the fact that it is a bug correction, sure. 
> Could you please prepare a nice e-mail with the full description?

Yes, I see... email was not nice enough to the scripts :-)
Here it is complete and clean below.

Regards,
Willy

[PATCH-2.4][MCAST]IPv6: small fix for ip6_mc_msfilter(...)

Multicast source filters aren't widely used yet, and that's really
the only feature that's affected if an application actually exercises
this bug, as far as I can tell. An ordinary filter-less multicast join
should still work, and only forwarded multicast traffic making use of
filters and doing empty-source filters with the MSFILTER ioctl would
be at risk of not getting multicast traffic forwarded to them because
the reports generated would not be based on the correct counts.
Initial 2.6 patch by Yan Zheng, bug explanation by David Stevens,
patch ACKed by David.

     Signed-off-by: Willy Tarreau <willy@w.ods.org>

diff -urN linux-2.4.32-rc2/net/ipv4/igmp.c linux-2.4.32-rc2-mcast/net/ipv4/igmp.c
--- linux-2.4.32-rc2/net/ipv4/igmp.c	2005-11-02 10:16:03.000000000 +0100
+++ linux-2.4.32-rc2-mcast/net/ipv4/igmp.c	2005-11-02 10:20:33.000000000 +0100
@@ -1876,8 +1876,11 @@
 			sock_kfree_s(sk, newpsl, IP_SFLSIZE(newpsl->sl_max));
 			goto done;
 		}
-	} else
-		newpsl = 0;
+	} else {
+		newpsl = NULL;
+		(void) ip_mc_add_src(in_dev, &msf->imsf_multiaddr,
+		       msf->imsf_fmode, 0, NULL, 0);
+	}
 	psl = pmc->sflist;
 	if (psl) {
 		(void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
diff -urN linux-2.4.32-rc2/net/ipv6/mcast.c linux-2.4.32-rc2-mcast/net/ipv6/mcast.c
--- linux-2.4.32-rc2/net/ipv6/mcast.c	2005-11-02 10:16:03.000000000 +0100
+++ linux-2.4.32-rc2-mcast/net/ipv6/mcast.c	2005-11-02 10:21:49.000000000 +0100
@@ -505,8 +505,11 @@
 			sock_kfree_s(sk, newpsl, IP6_SFLSIZE(newpsl->sl_max));
 			goto done;
 		}
-	} else
-		newpsl = 0;
+	} else {
+		newpsl = NULL;
+		(void) ip6_mc_add_src(idev, group, gsf->gf_fmode, 0, NULL, 0);
+	}
+
 	psl = pmc->sflist;
 	if (psl) {
 		(void) ip6_mc_del_src(idev, group, pmc->sfmode,

^ permalink raw reply

* Re: [PATCH 2.6.13] airo.c: remove delay in airo_get_scan
From: Michal Schmidt @ 2005-11-02 21:29 UTC (permalink / raw)
  To: Bill Moss; +Cc: linville, netdev, linux-kernel
In-Reply-To: <200511020347.jA23lvi9028538@localhost.localdomain>

Bill Moss wrote:
> Remove 3 second delay in airo_get_scan. Testing shows this delay is unnecessary. Users of NetworkManager
> find this delay make NetworkManager slow to connect.
> 
> --- a/drivers/net/wireless/airo.c	2005-11-01 21:21:04.000000000 -0500
> +++ b/drivers/net/wireless/airo.c	2005-11-01 21:22:41.000000000 -0500
> @@ -6918,7 +6918,7 @@
>  	/* When we are associated again, the scan has surely finished.
>  	 * Just in case, let's make sure enough time has elapsed since
>  	 * we started the scan. - Javier */
> -	if(ai->scan_timestamp && time_before(jiffies,ai->scan_timestamp+3*HZ)) {
> +	if(ai->scan_timestamp && time_before(jiffies,ai->scan_timestamp)) {
>  		/* Important note : we don't want to block the caller
>  		 * until results are ready for various reasons.
>  		 * First, managing wait queues is complex and racy
> 
> Signed-off-by: Bill Moss <bmoss@clemson.edu>

With this change, the time_before() test can't possibly succeed, can it? 
In that case, why not remove the if and its body completely?

Michal

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Marcelo Tosatti @ 2005-11-02 20:59 UTC (permalink / raw)
  To: David Stevens
  Cc: Willy Tarreau, David S. Miller, linux-kernel, netdev, Yan Zheng
In-Reply-To: <OF9D4BE592.A4BBC034-ON882570AD.00608386-882570AD.006143BA@us.ibm.com>

On Wed, Nov 02, 2005 at 09:42:37AM -0800, David Stevens wrote:
> Willy Tarreau <willy@w.ods.org> wrote on 11/02/2005 01:29:59 AM:
>  
> > Marcelo, David, does this backport seem appropriate for 2.4.32 ? I 
> verified
> > that it compiles, nothing more.
> 
>         Yes.
> 
> > If it's OK, I've noticed another patch that
> > Yan posted today and which might be of interest before a very solid 
> release.
> 
>         I think they should be reviewed first. :-)

Alright, then let it be tested in v2.6 first. Willy, can you queue for
2.4.33-pre ?

^ permalink raw reply

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
From: Richard Knutsson @ 2005-11-02 20:55 UTC (permalink / raw)
  To: Ashutosh Naik; +Cc: netdev, davej, acme, linux-net, akpm, linux-kernel, stable
In-Reply-To: <c216304e0511020516o5cfcd0b9u96a3220bf2694928@mail.gmail.com>

>
>
>>>This patch fixes compiler warnings when CONFIG_ISA and CONFIG_PCI are
>>>not enabled in the dgrc network driver.
>>>
>>>Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
>>>
>>>--
>>>diff -Naurp linux-2.6.14/drivers/net/dgrs.c
>>>linux-2.6.14-git1/drivers/net/dgrs.c---
>>>linux-2.6.14/drivers/net/dgrs.c     2005-10-28 05:32:08.000000000
>>>+0530
>>>+++ linux-2.6.14-git1/drivers/net/dgrs.c        2005-11-01
>>>10:30:03.000000000 +0530
>>>@@ -1549,8 +1549,12 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
>>>static int __init dgrs_init_module (void)  {
>>>       int     i;
>>>-       int eisacount = 0, pcicount = 0;
>>>-
>>>+#ifdef CONFIG_EISA
>>>+       int eisacount = 0;
>>>+#endif
>>>+#ifdef CONFIG_PCI
>>>+       int pcicount = 0;
>>>+#endif
>>>       /*
>>>        *      Command line variable overrides
>>>        *              debug=NNN
>>>-
>>>      
>>>

>>Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
>>
>>---
>>
>>diff -uNr a/drivers/net/dgrs.c b/drivers/net/dgrs.c
>>--- a/drivers/net/dgrs.c        2005-08-29 01:41:01.000000000 +0200
>>+++ b/drivers/net/dgrs.c        2005-10-26 15:53:43.000000000 +0200
>>@@ -1549,7 +1549,7 @@
>> static int __init dgrs_init_module (void)
>> {
>>        int     i;
>>-       int eisacount = 0, pcicount = 0;
>>+       int     count;
>>
>>        /*
>>         *      Command line variable overrides
>>@@ -1591,14 +1591,14 @@
>>         *      Find and configure all the cards
>>         */
>> #ifdef CONFIG_EISA
>>-       eisacount = eisa_driver_register(&dgrs_eisa_driver);
>>-       if (eisacount < 0)
>>-               return eisacount;
>>+       count = eisa_driver_register(&dgrs_eisa_driver);
>>+       if (count < 0)
>>+               return count;
>> #endif
>> #ifdef CONFIG_PCI
>>-       pcicount = pci_register_driver(&dgrs_pci_driver);
>>-       if (pcicount)
>>-               return pcicount;
>>+       count = pci_register_driver(&dgrs_pci_driver);
>>+       if (count)
>>+               return count;
>> #endif
>>        return 0;
>> }
>>    
>>
>
>Well, both of them do the same stuff, but one of these patches needs
>to be committed.
>
>Cheers
>Ashutosh
>  
>
Can both CONFIG_PCI and CONFIG_EISA be undefined at the same time? If 
so, I think you patch is better.
But on line 1015 in the dgrs.c-file (function dgrs_download()) there is 
an if-statement:
    if (priv0->plxreg)
    {    /* PCI bus */
        ...
    }
    else
    {    /* EISA bus */
        ...
from where I got the idea it needs either pci or eisa (or both). If this 
is true, I vote for my patch.

Live long and prosper
/Richard

PS
Rick's mail-address in the file seems invalid. Changed it to 
netdev@vger.kernel.org, since that is the address in the MAINTAINERS-file.
DS


^ permalink raw reply

* [test] airo : first WPA-PSK support
From: matthieu castet @ 2005-11-02 18:46 UTC (permalink / raw)
  To: netdev, hostap

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

Hi,

I have a working linux airo driver that support  WPA-PSK, but it is very 
ugly.
It only support one card, and don't support MPI350. Also it only works 
with WPA.

Currently the RX and TX key are set only for set_tx=1 key. The card 
should report valid mic key with EV_MIC, but the driver hangs for an 
unknow reason.

There still lot's of work to complete WPA support and merge it with an 
universal driver.

Attached a diff against 2.6.14 kernel.

If you test it, please send me your comment.


Matthieu

[-- Attachment #2: airo_wpa.diff --]
[-- Type: text/x-patch, Size: 19639 bytes --]

--- /usr/src/linux-2.6.14/drivers/net/wireless/airo.c	2005-10-28 02:02:08.000000000 +0200
+++ airo.c	2005-11-02 19:36:35.000000000 +0100
@@ -46,6 +46,26 @@
 #include <linux/pci.h>
 #include <asm/uaccess.h>
 
+#include <linux/crypto.h>
+#include <asm/scatterlist.h>
+
+
+int trace_io=0;
+u8 rx_key [8];
+u8 tx_key [8];
+struct crypto_tfm *tfm_michael = NULL;
+
+static void dump(u8* data,int size) {
+        int i;  
+        printk("0: ");
+        for (i=0;i<size;i++) {
+                printk("%2x ", data[i]);
+                if (i%0x10==0xf)
+                        printk("\n%x: ", i+1);
+        }
+        printk("\n");
+}
+
 #ifdef CONFIG_PCI
 static struct pci_device_id card_ids[] = {
 	{ 0x14b9, 1, PCI_ANY_ID, PCI_ANY_ID, },
@@ -85,7 +105,7 @@
 #endif
 
 /* Support Cisco MIC feature */
-#define MICSUPPORT
+//#define MICSUPPORT
 
 #if defined(MICSUPPORT) && !defined(CONFIG_CRYPTO)
 #warning MIC support requires Crypto API
@@ -469,8 +489,10 @@
 #define RID_STATSDELTACLEAR 0xFF6A
 #define RID_ECHOTEST_RID 0xFF70
 #define RID_ECHOTEST_RESULTS 0xFF71
-#define RID_BSSLISTFIRST 0xFF72
-#define RID_BSSLISTNEXT  0xFF73
+//#define RID_BSSLISTFIRST 0xFF72
+//#define RID_BSSLISTNEXT  0xFF73
+#define RID_BSSLISTFIRST 0xFF74
+#define RID_BSSLISTNEXT  0xFF75
 
 typedef struct {
 	u16 cmd;
@@ -505,6 +527,15 @@
 	u8 key[16];
 } WepKeyRid;
 
+typedef struct {
+	u16 len;
+	u16 kindex;
+	u8 mac[ETH_ALEN];
+	u16 klen;
+	u8 key[48];
+} WpaKeyRid;
+
+
 /* These structures are from the Aironet's PC4500 Developers Manual */
 typedef struct {
 	u16 len;
@@ -574,7 +605,7 @@
 	u16 beaconListenTimeout;
 	u16 joinNetTimeout;
 	u16 authTimeout;
-	u16 authType;
+	u16 authType; /* 31 */
 #define AUTH_OPEN 0x1
 #define AUTH_ENCRYPT 0x101
 #define AUTH_SHAREDKEY 0x102
@@ -589,7 +620,7 @@
 #define DISABLE_REFRESH 0xFFFF
 	u16 _reserved1a[1];
 	/*---------- Power save operation ----------*/
-	u16 powerSaveMode;
+	u16 powerSaveMode; /* 40 */
 #define POWERSAVE_CAM 0
 #define POWERSAVE_PSP 1
 #define POWERSAVE_PSPCAM 2
@@ -602,7 +633,7 @@
 	/*---------- Ap/Ibss config items ----------*/
 	u16 beaconPeriod;
 	u16 atimDuration;
-	u16 hopPeriod;
+	u16 hopPeriod; /* 50 */
 	u16 channelSet;
 	u16 channel;
 	u16 dtimPeriod;
@@ -619,15 +650,15 @@
 #define TXPOWER_DEFAULT 0
 	u16 rssiThreshold;
 #define RSSI_DEFAULT 0
-        u16 modulation;
+        u16 modulation; /* 60 */
 #define PREAMBLE_AUTO 0
 #define PREAMBLE_LONG 1
 #define PREAMBLE_SHORT 2
 	u16 preamble;
 	u16 homeProduct;
-	u16 radioSpecific;
+	u16 radioSpecific; /* 63 */
 	/*---------- Aironet Extensions ----------*/
-	u8 nodeName[16];
+	u8 nodeName[16]; /* 71 */
 	u16 arlThreshold;
 	u16 arlDecay;
 	u16 arlDelay;
@@ -642,6 +673,9 @@
 #define MAGIC_STAY_IN_CAM (1<<10)
 	u8 magicControl;
 	u16 autoWake;
+	u16 _reserved5[4]; /* 81 */
+	u16 enc_algo;
+	u16 wap;
 } ConfigRid;
 
 typedef struct {
@@ -771,6 +805,8 @@
   } fh;
   u16 dsChannel;
   u16 atimWindow;
+  u16 junk[17];
+  u8 iep[40];
 } BSSListRid;
 
 typedef struct {
@@ -793,6 +829,13 @@
 } MICRid;
 
 typedef struct {
+	u16 len;
+	u16 unknow[16]; /* Is there the size here ??? */
+	u16 reqIE[26];
+	u16 respIE[3];
+} IERID;
+
+typedef struct {
 	u16 typelen;
 
 	union {
@@ -1199,6 +1242,9 @@
 	mic_module		mod[2];
 	mic_statistics		micstats;
 #endif
+	u8 LLC [10];
+
+	
 	HostRxDesc rxfids[MPI_MAX_FIDS]; // rx/tx/config MPI350 descriptors
 	HostTxDesc txfids[MPI_MAX_FIDS];
 	HostRidDesc config_desc;
@@ -1232,6 +1278,41 @@
 static int flashputbuf(struct airo_info *ai);
 static int flashrestart(struct airo_info *ai,struct net_device *dev);
 
+
+/* MIC for WPA */
+static void micinit(struct airo_info *ai)
+{
+	MICRid mic_rid;
+
+	clear_bit(JOB_MIC, &ai->flags);
+	PC4500_readrid(ai, RID_MIC, &mic_rid, sizeof(mic_rid), 0);
+	up(&ai->sem);
+
+	if (mic_rid.state & 0xff) {
+		/* Key must be valid and different */
+		if (mic_rid.multicastValid) {
+		}
+
+		/* Key must be valid and different */
+		if (mic_rid.unicastValid) {
+			memcpy(rx_key,mic_rid.unicast,8);
+			memcpy(tx_key,mic_rid.unicast+8,8);
+	
+		}
+	} else {
+      /* So next time we have a valid key and mic is enabled, we will update
+       * the sequence number if the key is the same as before.
+       */
+		memset(rx_key,0,8);
+		memset(tx_key,0,8);
+	}
+	dump(rx_key, 8);
+	dump(tx_key, 8);
+}
+
+static int micsetup(struct airo_info *ai) {
+	return SUCCESS;
+}
 #ifdef MICSUPPORT
 /***********************************************************************
  *                              MIC ROUTINES                           *
@@ -1244,7 +1325,7 @@
 static void emmh32_init(emmh32_context *context);
 static void emmh32_update(emmh32_context *context, u8 *pOctets, int len);
 static void emmh32_final(emmh32_context *context, u8 digest[4]);
-static int flashpchar(struct airo_info *ai,int byte,int dwelltime);
+/*static */int flashpchar(struct airo_info *ai,int byte,int dwelltime);
 
 /* micinit - Initialize mic seed */
 
@@ -1755,7 +1836,23 @@
 	}
 	return rc;
 }
+static int writeWpaKeyRid(struct airo_info*ai, WpaKeyRid *pwkr, int lock) {
+	int rc;
+	WpaKeyRid wkr = *pwkr;
 
+	wkr.len = cpu_to_le16(sizeof(WpaKeyRid));
+	wkr.kindex = cpu_to_le16(wkr.kindex);
+	wkr.klen = cpu_to_le16(wkr.klen);
+
+	//for (rc=0;rc< sizeof(WpaKeyRid)/2; rc++)
+	//	printk("wpa %d : %x\n", rc, *(((u16*)&(wkr)) + rc));
+
+	trace_io = 0;
+	rc = PC4500_writerid(ai, 0xff25, &wkr, sizeof(wkr), lock);
+	trace_io = 0;
+	if (rc!=SUCCESS) printk(KERN_ERR "airo:  WEP_TEMP set %x\n", rc);
+	return rc;
+}
 static int readSsidRid(struct airo_info*ai, SsidRid *ssidr) {
 	int i;
 	int rc = PC4500_readrid(ai, RID_SSID, ssidr, sizeof(*ssidr), 1);
@@ -2412,6 +2509,7 @@
 #ifdef MICSUPPORT
 	crypto_free_tfm(ai->tfm);
 #endif
+	crypto_free_tfm(tfm_michael);
 	del_airo_dev( dev );
 	free_netdev( dev );
 }
@@ -2769,8 +2867,9 @@
 	SET_NETDEV_DEV(dev, dmdev);
 
 
-	if (test_bit(FLAG_MPI,&ai->flags))
+	//if (test_bit(FLAG_MPI,&ai->flags))
 		reset_card (dev, 1);
+	msleep(300);
 
 	rc = request_irq( dev->irq, airo_interrupt, SA_SHIRQ, dev->name, dev );
 	if (rc) {
@@ -2898,8 +2997,21 @@
 	struct airo_info *ai = dev->priv;
 	union iwreq_data wrqu;
 	StatusRid status_rid;
+	IERID ie_rid;
 
 	clear_bit(JOB_EVENT, &ai->flags);
+
+	PC4500_readrid(ai, 0xff76, &ie_rid, sizeof(ie_rid), 0);
+
+	memset(&wrqu, 0, sizeof(wrqu));
+	wrqu.data.length = 52;
+	wireless_send_event(dev, IWEVASSOCREQIE, &wrqu, ie_rid.reqIE);
+
+	wrqu.data.length = 6;
+	wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, ie_rid.respIE);
+	memset(&wrqu, 0, sizeof(wrqu));
+
+
 	PC4500_readrid(ai, RID_STATUS, &status_rid, sizeof(status_rid), 0);
 	up(&ai->sem);
 	wrqu.data.length = 0;
@@ -3024,12 +3136,14 @@
 
 		if ( status & EV_MIC ) {
 			OUT4500( apriv, EVACK, EV_MIC );
-#ifdef MICSUPPORT
+			printk("new mic key...\n");
+			//XXX update mic key for WPA...
+//#ifdef MICSUPPORT
 			if (test_bit(FLAG_MIC_CAPABLE, &apriv->flags)) {
 				set_bit(JOB_MIC, &apriv->flags);
 				wake_up_interruptible(&apriv->thr_wait);
 			}
-#endif
+//#endif
 		}
 		if ( status & EV_LINK ) {
 			union iwreq_data	wrqu;
@@ -3112,6 +3226,13 @@
 				/* Send event to user space */
 				wireless_send_event(dev, SIOCGIWAP, &wrqu,NULL);
 			}
+
+			if(newStatus == ASSOCIATED) {
+				/*IWEVASSOCREQIE*/
+				/*IWEVASSOCRESPIE*/
+			}
+			
+			printk("status : %x\n", newStatus);
 		}
 
 		/* Check to see if there is something to receive */
@@ -3264,6 +3385,32 @@
 			}
 #endif /* WIRELESS_SPY */
 			OUT4500( apriv, EVACK, EV_RX);
+			if (tfm_michael && rx_key [0]) {
+				struct scatterlist sg[3];
+				u8 mic [8];
+
+				sg[0].page = virt_to_page(skb->data);
+				sg[0].offset = offset_in_page(skb->data);
+				sg[0].length = 12;
+
+
+				sg[1].page = virt_to_page(apriv->LLC);
+				sg[1].offset = offset_in_page(apriv->LLC);
+				sg[1].length = sizeof(apriv->LLC);
+
+				sg[2].page = virt_to_page(skb->data+12);
+				sg[2].offset = offset_in_page(skb->data+12);
+				sg[2].length = len  - 8;
+				crypto_digest_init(tfm_michael);
+				crypto_digest_setkey(tfm_michael, rx_key, 8);
+				crypto_digest_update(tfm_michael, sg, 3);
+				crypto_digest_final(tfm_michael, mic);
+				if (memcmp(mic, skb->data + skb->len - 8, 8))
+					printk("rx mic error \n");
+
+				len -= 8;
+				skb_trim (skb, len + hdrlen);
+			}
 
 			if (test_bit(FLAG_802_11, &apriv->flags)) {
 				skb->mac.raw = skb->data;
@@ -3357,8 +3504,10 @@
 static void OUT4500( struct airo_info *ai, u16 reg, u16 val ) {
 	if (test_bit(FLAG_MPI,&ai->flags))
 		reg <<= 1;
-	if ( !do8bitIO )
-		outw( val, ai->dev->base_addr + reg );
+	if ( !do8bitIO ) {
+		if (trace_io)
+		printk("->port (0x%x) val :0x%x\n",reg, val);
+		outw( val, ai->dev->base_addr + reg ); }
 	else {
 		outb( val & 0xff, ai->dev->base_addr + reg );
 		outb( val >> 8, ai->dev->base_addr + reg + 1 );
@@ -3711,6 +3860,7 @@
 		ai->config.authType = AUTH_OPEN;
 		ai->config.modulation = MOD_CCK;
 
+		//XXX don"t work for wpa...
 #ifdef MICSUPPORT
 		if ((cap_rid.len>=sizeof(cap_rid)) && (cap_rid.extSoftCap&1) &&
 		    (micsetup(ai) == SUCCESS)) {
@@ -3718,6 +3868,17 @@
 			set_bit(FLAG_MIC_CAPABLE, &ai->flags);
 		}
 #endif
+			tfm_michael = crypto_alloc_tfm("michael_mic", 0);
+			
+			{
+				char LLC1 [] = {0, 0, 0, 0, 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
+				memcpy(ai->LLC, LLC1, sizeof(LLC1));
+			}
+			if (tfm_michael == NULL) {
+				printk(KERN_DEBUG "crypto API michael_mic\n");
+			}
+
+			
 
 		/* Save off the MAC */
 		for( i = 0; i < ETH_ALEN; i++ ) {
@@ -3774,6 +3935,7 @@
 		return ERROR;
 	}
 
+#if 0
 	/* Grab the initial wep key, we gotta save it for auto_wep */
 	rc = readWepKeyRid(ai, &wkr, 1, lock);
 	if (rc == SUCCESS) do {
@@ -3783,6 +3945,7 @@
 		}
 		rc = readWepKeyRid(ai, &wkr, 0, lock);
 	} while(lastindex != wkr.kindex);
+#endif
 
 	if (auto_wep) {
 		ai->expires = RUN_AT(3*HZ);
@@ -3950,7 +4113,12 @@
 static int bap_write(struct airo_info *ai, const u16 *pu16Src,
 		     int bytelen, int whichbap)
 {
+	int i;
 	bytelen = (bytelen + 1) & (~1); // round up to even value
+	if (trace_io)
+	for (i=0;i<bytelen>>1;i++) {
+		printk("   idx : %d val :0x%x\n", i, *(pu16Src+i));
+	}
 	if ( !do8bitIO )
 		outsw( ai->dev->base_addr+DATA0+whichbap,
 		       pu16Src, bytelen>>1 );
@@ -4206,12 +4374,49 @@
 	if (bap_setup(ai, txFid, 0x0036, BAP1) != SUCCESS) return ERROR;
 	/* The hardware addresses aren't counted as part of the payload, so
 	 * we have to subtract the 12 bytes for the addresses off */
-	payloadLen = cpu_to_le16(len + miclen);
+	//if (tfm_michael && tx_key [0])
+	//	miclen += 8;
+	payloadLen = cpu_to_le16(len + miclen + 8);
 	bap_write(ai, &payloadLen, sizeof(payloadLen),BAP1);
 	bap_write(ai, (const u16*)pPacket, sizeof(etherHead), BAP1);
 	if (miclen)
 		bap_write(ai, (const u16*)&pMic, miclen, BAP1);
+	if (tfm_michael && tx_key [0]) {
+				struct scatterlist sg[3];
+				u8 mic [8];
+
+				sg[0].page = virt_to_page(pPacket);
+				sg[0].offset = offset_in_page(pPacket);
+				sg[0].length = sizeof(etherHead);
+
+
+				sg[1].page = virt_to_page(ai->LLC);
+				sg[1].offset = offset_in_page(ai->LLC);
+				sg[1].length = sizeof(ai->LLC);
+
+				sg[2].page = virt_to_page(pPacket + sizeof(etherHead));
+				sg[2].offset = offset_in_page(pPacket + sizeof(etherHead));
+				sg[2].length = len;
+				crypto_digest_init(tfm_michael);
+				crypto_digest_setkey(tfm_michael, tx_key, 8);
+				crypto_digest_update(tfm_michael, sg, 3);
+				crypto_digest_final(tfm_michael, mic);
+				
+				//XXX ugly hack
+				bap_write(ai, (const u16*)(pPacket + sizeof(etherHead)), len - (len&1), BAP1);
+				if (len&1) {
+					u8 tmp [2];
+					tmp [0] = pPacket [sizeof(etherHead) + len-1];
+					tmp [1] = mic[0];
+					bap_write(ai, (const u16*)tmp, 2, BAP1);
+					bap_write(ai, (const u16*)(mic+1), sizeof(mic)-1, BAP1);
+				}
+				else
+					bap_write(ai, (const u16*)mic, sizeof(mic), BAP1);
+		}
+	else
 	bap_write(ai, (const u16*)(pPacket + sizeof(etherHead)), len, BAP1);
+
 	// issue the transmit command
 	memset( &cmd, 0, sizeof( cmd ) );
 	cmd.cmd = CMD_TRANSMIT;
@@ -5125,6 +5330,8 @@
 	return 0;
 }
 
+
+
 static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {
 	struct proc_data *data;
 	struct proc_dir_entry *dp = PDE(inode);
@@ -5401,6 +5608,7 @@
 static void timer_func( struct net_device *dev ) {
 	struct airo_info *apriv = dev->priv;
 	Resp rsp;
+#if 0
 
 /* We don't have a link so try changing the authtype */
 	readConfigRid(apriv, 0);
@@ -5428,6 +5636,7 @@
 	set_bit (FLAG_COMMIT, &apriv->flags);
 	writeConfigRid(apriv, 0);
 	enable_MAC(apriv, &rsp, 0);
+#endif
 	up(&apriv->sem);
 
 /* Schedule check to see if the change worked */
@@ -5815,7 +6024,7 @@
 	/* If none, we may want to get the one that was set */
 
 	/* Push it out ! */
-	dwrq->length = status_rid.SSIDlen + 1;
+	dwrq->length = status_rid.SSIDlen;
 	dwrq->flags = 1; /* active */
 
 	return 0;
@@ -6278,6 +6487,102 @@
 	return -EINPROGRESS;		/* Call commit handler */
 }
 
+static int airo_set_encode_ext(struct net_device *dev,
+			   struct iw_request_info *info,
+			   union iwreq_data *wrqu,
+			   char *extra)
+{
+	struct iw_encode_ext *ext = (struct iw_encode_ext *) extra;
+	struct airo_info *local = dev->priv;
+	CapabilityRid cap_rid;		/* Card capability info */
+	static const unsigned char macaddr[ETH_ALEN] = { 0x01, 0, 0, 0, 0, 0 };
+	WpaKeyRid wkr;
+	Resp rsp;
+
+	int index = (wrqu->encoding.flags & IW_ENCODE_INDEX) - 1;
+
+	/* Is WEP supported ? */
+	readCapabilityRid(local, &cap_rid, 1);
+	/* Older firmware doesn't support this...
+	if(!(cap_rid.softCap & 2)) {
+		return -EOPNOTSUPP;
+	} */
+	readConfigRid(local, 1);
+
+		/* Check the index (none -> use current) */
+		if ((index < 0) || (index >= ((cap_rid.softCap & 0x80) ? 4:1)))
+			return -EINVAL;
+
+
+		//printk("set wpa : %d %d %x\n", ext->alg, ext->key_len, sizeof(wkr));
+		msleep(10);
+	if (down_interruptible(&local->sem))
+			return ERROR;
+
+	memset(&wkr, 0, sizeof(wkr));
+	wkr.len = sizeof(wkr);
+	if ((wrqu->encoding.flags & IW_ENCODE_DISABLED) ||
+			ext->alg == IW_ENCODE_ALG_NONE || ext->key_len == 0) {
+		//remove key
+		wkr.kindex = index;
+		memcpy( wkr.mac, macaddr, ETH_ALEN );
+		printk(KERN_INFO "Removing key %d\n", index);
+
+		memset(rx_key,0,8);
+		memset(tx_key,0,8);
+	}
+	else if (ext->alg == IW_ENCODE_ALG_TKIP && ext->key_len == 32) {
+		wkr.kindex = index;
+		memcpy( wkr.mac, macaddr, ETH_ALEN );
+		wkr.klen = /*ext->key_len*/ 0x30;
+		//memcpy(wkr.key, ext->key, ext->key_len);
+		/* firmware use ndis order + a hole */
+		memcpy(wkr.key, ext->key, 16);
+		memcpy(wkr.key + 32, ext->key + 24, 8); /*RX*/
+		memcpy(wkr.key + 40, ext->key + 16, 8); /*TX*/
+		/*printk("key : ");
+		int i;
+		for (i=0;i<32;i++)
+			printk("%x ", (char)(*(char*)(ext->key + i)));
+		printk("\n");*/
+		dump(ext->key, 32);
+		printk(KERN_INFO "Setting key %d\n", index);
+	}
+	else
+		return -EINVAL;
+
+
+
+	printk("len %d, idx %d, mac %x, key %x\n", wkr.klen, wkr.kindex, wkr.mac[0], wkr.key[0]);
+
+	//disable_MAC(local, 1);
+	//if (index >= 3)
+	writeWpaKeyRid(local, &wkr, 0);
+	//enable_MAC(local, &rsp, 1);
+
+	if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
+	//disable_MAC(local, 1);
+		//set the key active
+		wkr.kindex = 0xffff;
+		wkr.mac[0] = (char)index;
+		//wkr.klen = /*ext->key_len*/0x30;
+		memset(wkr.key, 0, sizeof(wkr.key));
+		printk(KERN_INFO "Setting transmit key to %d\n", index);
+		writeWpaKeyRid(local, &wkr, 0);
+
+
+		memcpy(rx_key,ext->key+24,8);
+		memcpy(tx_key,ext->key+16,8);
+
+	//enable_MAC(local, &rsp, 1);
+	}
+
+	up(&local->sem);
+	return 0;
+}
+
+
+
 /*------------------------------------------------------------------*/
 /*
  * Wireless Handler : get Encryption Key
@@ -6571,6 +6876,8 @@
 				IW_EVENT_CAPA_MASK(SIOCGIWSCAN));
 	range->event_capa[1] = IW_EVENT_CAPA_K_1;
 	range->event_capa[4] = IW_EVENT_CAPA_MASK(IWEVTXDROP);
+
+	range->enc_capa = IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_WPA;
 	return 0;
 }
 
@@ -6821,6 +7128,7 @@
 	u16			capabilities;
 	char *			current_val;	/* For rates */
 	int			i;
+	unsigned char buf[40/*MAX_WPA_IE_LEN*/ * 2 + 30];
 
 	/* First entry *MUST* be the AP MAC address */
 	iwe.cmd = SIOCGIWAP;
@@ -6909,6 +7217,35 @@
 
 	/* The other data in the scan result are not really
 	 * interesting, so for now drop it - Jean II */
+	iwe.cmd = IWEVCUSTOM;
+	sprintf(buf, "bcn_int=%d", bss->beaconInterval);
+	iwe.u.data.length = strlen(buf);
+	current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
+
+	iwe.cmd = IWEVCUSTOM;
+	sprintf(buf, "atim=%u", bss->atimWindow);
+	current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
+	
+	if (/*WPA*/ 1) {
+		unsigned char ielen = 2 + bss->iep[1];
+		if (ielen <= 40/*SSID_MAX_WPA_IE_LEN*/) {
+
+			if (bss->iep[0] == 0xdd /* WLAN_EID_GENERIC */ && bss->iep[1] >= 4
+					&& memcmp(bss->iep + 2, "\x00\x50\xf2\x01", 4) == 0) {
+				unsigned char *p = buf;
+				p += sprintf(p, "wpa_ie=");
+				for (i = 0; i < ielen; i++)
+					p += sprintf(p, "%02x", bss->iep[i]);
+
+				iwe.cmd = IWEVCUSTOM;
+				iwe.u.data.length = strlen(buf);
+				current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe,
+						buf);
+			}
+		}
+	}
+
+	
 	return current_ev;
 }
 
@@ -7021,6 +7358,79 @@
 	return 0;
 }
 
+static int airo_set_auth(struct net_device *dev, struct iw_request_info *info,
+		struct iw_param *data, char *extra)
+{
+	struct airo_info *local = dev->priv;
+	readConfigRid(local, 1);
+
+	switch (data->flags & IW_AUTH_INDEX) {
+		case IW_AUTH_WPA_ENABLED:
+			if (data->value == 0) {
+				printk("WPA dis\n");
+				local->config.wap=1;
+				local->config.authType=0x1;
+			}
+			else {
+				printk("WPA enable\n");
+				local->config.wap=0x8;
+				local->config.enc_algo=0x210;
+				local->config.authType=0xc101;
+				local->config._reserved5[0]=0x40;
+			}
+			break;
+		default:
+			return /*-EOPNOTSUPP*/0;
+	}
+
+	set_bit (FLAG_COMMIT, &local->flags);
+
+	return -EINPROGRESS;		/* Call commit handler */
+
+}
+
+static int airo_set_ie(struct net_device *dev,
+		struct iw_request_info *info,
+		struct iw_point *data, char *extra)
+{
+return 0;
+}
+
+
+static int airo_disasociate(struct net_device *dev,
+		struct iw_request_info *info,
+		struct iw_point *data, char *extra)
+{
+	struct airo_info *local = dev->priv;
+	Resp rsp;
+#if 0
+	Cmd cmd;
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.cmd=CMD_LOSE_SYNC;
+	if (down_interruptible(&local->sem))
+		return -ERESTARTSYS;
+	issuecommand(local, &cmd, &rsp);
+	up(&local->sem);
+#else
+	SsidRid SSID_rid;		/* SSIDs */
+
+	/* reset the list */
+	memset(&SSID_rid, 0, sizeof(SSID_rid));
+
+	/* Set the SSID */
+	strcpy(SSID_rid.ssids[0].ssid, "tsunami");
+	SSID_rid.ssids[0].len = 7;
+	SSID_rid.len = sizeof(SSID_rid);
+	/* Write it to the card */
+	disable_MAC(local, 1);
+	writeSsidRid(local, &SSID_rid, 1);
+	enable_MAC(local, &rsp, 1);
+
+#endif
+	return 0;
+
+}
+
 /*------------------------------------------------------------------*/
 /*
  * Structures to export the Wireless Handlers
@@ -7082,6 +7492,10 @@
 	(iw_handler) airo_get_encode,		/* SIOCGIWENCODE */
 	(iw_handler) airo_set_power,		/* SIOCSIWPOWER */
 	(iw_handler) airo_get_power,		/* SIOCGIWPOWER */
+	[SIOCSIWAUTH-SIOCSIWCOMMIT] = (iw_handler) airo_set_auth,
+	[SIOCSIWGENIE-SIOCSIWCOMMIT] = (iw_handler) airo_set_ie,
+	[SIOCSIWENCODEEXT-SIOCSIWCOMMIT] = (iw_handler) airo_set_encode_ext,
+	[SIOCSIWMLME-SIOCSIWCOMMIT] = (iw_handler) airo_disasociate,
 };
 
 /* Note : don't describe AIROIDIFC and AIROOLDIDIFC in here.
@@ -7570,7 +7984,7 @@
  * x 50us for  echo .
  */
 
-static int flashpchar(struct airo_info *ai,int byte,int dwelltime) {
+/*static*/ int flashpchar(struct airo_info *ai,int byte,int dwelltime) {
 	int echo;
 	int waittime;
 

[-- Attachment #3: Type: text/plain, Size: 132 bytes --]

_______________________________________________
HostAP mailing list
HostAP@shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: David Stevens @ 2005-11-02 17:42 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: David S. Miller, linux-kernel, Marcelo Tosatti, netdev, Yan Zheng
In-Reply-To: <20051102092959.GA15515@alpha.home.local>

Willy Tarreau <willy@w.ods.org> wrote on 11/02/2005 01:29:59 AM:
 
> Marcelo, David, does this backport seem appropriate for 2.4.32 ? I 
verified
> that it compiles, nothing more.

        Yes.

> If it's OK, I've noticed another patch that
> Yan posted today and which might be of interest before a very solid 
release.

        I think they should be reviewed first. :-)

                                                +-DLS

^ permalink raw reply

* Re: ancient ieee80211/ipw2200 drivers in recent kernel (2.6.14)
From: Christoph Hellwig @ 2005-11-02 16:26 UTC (permalink / raw)
  To: Mikhail Gusarov; +Cc: debian-kernel, NetDev
In-Reply-To: <871x1zk0a6.fsf@vertex.dottedmag.net>

On Wed, Nov 02, 2005 at 12:54:09PM +0600, Mikhail Gusarov wrote:
> So, having in mind the two levels of 'stablenesss': kernel
> 'stableness' and modules 'stableness' :) we should find the way to
> exclude discussed modules from the build, because in-kernel versions
> will always be, erm..., slightly (1.0.0 is mentioned only as 'stone
> age' in the mailing list of ipw2200 developers) outdated due to fact
> integration and testing gets some time in upstream kernels. I propose
> just to disable compilation of this drivers: everyone will be able to
> compile the recent version using ipw2200-source we provide.

The kernel drivers aren't stable but obsolete.  Because of that ever
distribution that supports it's users must patch in a more recent one,
which is what we should do for debian aswell.

It's a pity the braindead Intel policies don't allow us to have an uptodate
driver in mainline.

^ permalink raw reply

* Re: [PATCH][MCAST]Two fix for implementation of MLDv2 .
From: Yan Zheng @ 2005-11-02 14:23 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, David Stevens
In-Reply-To: <7e77d27c0511020538o4b1f3244l@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2382 bytes --]

Hi.

Here is my another patch. It makes a node send state change report properly when a multicast address's soure filter mode change is cause by forwarding state change and etc.

Regards.

Signed-off-by: Yan Zheng <yanzheng@21cn.com>

Index:net/ipv6/mcast.c
===========================================================
--- linux-2.6.14/net/ipv6/mcast.c	2005-10-30 23:09:33.000000000 +0800
+++ /tmp/ipv6/mcast.c	2005-11-02 22:04:32.000000000 +0800
@@ -128,7 +128,8 @@ static DEFINE_RWLOCK(ipv6_sk_mc_lock);
 
 static struct socket *igmp6_socket;
 
-int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr);
+static int ipv6_dev_mc_dec_intern(struct inet6_dev *idev, 
+			struct in6_addr *addr, int delta);
 
 static void igmp6_join_group(struct ifmcaddr6 *ma);
 static void igmp6_leave_group(struct ifmcaddr6 *ma);
@@ -270,7 +271,7 @@ int ipv6_sock_mc_drop(struct sock *sk, i
 
 				if (idev) {
 					(void) ip6_mc_leave_src(sk,mc_lst,idev);
-					__ipv6_dev_mc_dec(idev, &mc_lst->addr);
+					ipv6_dev_mc_dec_intern(idev,&mc_lst->addr,1);
 					in6_dev_put(idev);
 				}
 				dev_put(dev);
@@ -336,7 +337,7 @@ void ipv6_sock_mc_close(struct sock *sk)
 
 			if (idev) {
 				(void) ip6_mc_leave_src(sk, mc_lst, idev);
-				__ipv6_dev_mc_dec(idev, &mc_lst->addr);
+				ipv6_dev_mc_dec_intern(idev, &mc_lst->addr, 1);
 				in6_dev_put(idev);
 			}
 			dev_put(dev);
@@ -907,10 +908,9 @@ int ipv6_dev_mc_inc(struct net_device *d
 	return 0;
 }
 
-/*
- *	device multicast group del
- */
-int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr)
+
+static int ipv6_dev_mc_dec_intern(struct inet6_dev *idev, 
+			struct in6_addr *addr, int delta)
 {
 	struct ifmcaddr6 *ma, **map;
 
@@ -920,20 +920,27 @@ int __ipv6_dev_mc_dec(struct inet6_dev *
 			if (--ma->mca_users == 0) {
 				*map = ma->next;
 				write_unlock_bh(&idev->lock);
-
 				igmp6_group_dropped(ma);
-
 				ma_put(ma);
 				return 0;
 			}
 			write_unlock_bh(&idev->lock);
+			if (!delta && ip6_mc_del_src(idev, addr, 
+					MCAST_EXCLUDE, 0, NULL, 0))
+				return -EINVAL; // bug 	
 			return 0;
 		}
 	}
 	write_unlock_bh(&idev->lock);
-
 	return -ENOENT;
 }
+/*
+ *	device multicast group del
+ */
+int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr)
+{
+	return ipv6_dev_mc_dec_intern(idev, addr, 0);
+}
 
 int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr)
 {

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 5996 bytes --]

--- linux-2.6.14/net/ipv6/mcast.c	2005-10-30 23:09:33.000000000 +0800
+++ linux/net/ipv6/mcast.c	2005-11-02 21:25:27.000000000 +0800
@@ -128,7 +128,8 @@ static DEFINE_RWLOCK(ipv6_sk_mc_lock);
 
 static struct socket *igmp6_socket;
 
-int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr);
+static int ipv6_dev_mc_dec_intern(struct inet6_dev *idev, 
+			struct in6_addr *addr, int delta);
 
 static void igmp6_join_group(struct ifmcaddr6 *ma);
 static void igmp6_leave_group(struct ifmcaddr6 *ma);
@@ -164,7 +165,7 @@ static int ip6_mc_leave_src(struct sock 
 #define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
 #define MLDV2_EXP(thresh, nbmant, nbexp, value) \
 	((value) < (thresh) ? (value) : \
-	((MLDV2_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \
+	((MLDV2_MASK(value, nbmant) | (1<<(nbmant))) << \
 	(MLDV2_MASK((value) >> (nbmant), nbexp) + (nbexp))))
 
 #define MLDV2_QQIC(value) MLDV2_EXP(0x80, 4, 3, value)
@@ -270,7 +271,7 @@ int ipv6_sock_mc_drop(struct sock *sk, i
 
 				if (idev) {
 					(void) ip6_mc_leave_src(sk,mc_lst,idev);
-					__ipv6_dev_mc_dec(idev, &mc_lst->addr);
+					ipv6_dev_mc_dec_intern(idev,&mc_lst->addr,1);
 					in6_dev_put(idev);
 				}
 				dev_put(dev);
@@ -336,7 +337,7 @@ void ipv6_sock_mc_close(struct sock *sk)
 
 			if (idev) {
 				(void) ip6_mc_leave_src(sk, mc_lst, idev);
-				__ipv6_dev_mc_dec(idev, &mc_lst->addr);
+				ipv6_dev_mc_dec_intern(idev, &mc_lst->addr, 1);
 				in6_dev_put(idev);
 			}
 			dev_put(dev);
@@ -545,8 +546,10 @@ int ip6_mc_msfilter(struct sock *sk, str
 			sock_kfree_s(sk, newpsl, IP6_SFLSIZE(newpsl->sl_max));
 			goto done;
 		}
-	} else
+	} else {
 		newpsl = NULL;
+		(void) ip6_mc_add_src(idev, group, gsf->gf_fmode, 0, NULL, 0);
+	}
 	psl = pmc->sflist;
 	if (psl) {
 		(void) ip6_mc_del_src(idev, group, pmc->sfmode,
@@ -907,10 +910,8 @@ int ipv6_dev_mc_inc(struct net_device *d
 	return 0;
 }
 
-/*
- *	device multicast group del
- */
-int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr)
+static int ipv6_dev_mc_dec_intern(struct inet6_dev *idev, 
+			struct in6_addr *addr, int delta)
 {
 	struct ifmcaddr6 *ma, **map;
 
@@ -920,20 +921,27 @@ int __ipv6_dev_mc_dec(struct inet6_dev *
 			if (--ma->mca_users == 0) {
 				*map = ma->next;
 				write_unlock_bh(&idev->lock);
-
 				igmp6_group_dropped(ma);
-
 				ma_put(ma);
 				return 0;
 			}
 			write_unlock_bh(&idev->lock);
+			if (!delta && ip6_mc_del_src(idev, addr, 
+					MCAST_EXCLUDE, 0, NULL, 0))
+			       return -EINVAL; // bug 	
 			return 0;
 		}
 	}
 	write_unlock_bh(&idev->lock);
-
 	return -ENOENT;
 }
+/*
+ *	device multicast group del
+ */
+int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr)
+{
+	return ipv6_dev_mc_dec_intern(idev, addr, 0);
+}
 
 int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr)
 {
@@ -1087,7 +1095,7 @@ static void mld_marksources(struct ifmca
 
 int igmp6_event_query(struct sk_buff *skb)
 {
-	struct mld2_query *mlh2 = (struct mld2_query *) skb->h.raw;
+	struct mld2_query *mlh2 = NULL;
 	struct ifmcaddr6 *ma;
 	struct in6_addr *group;
 	unsigned long max_delay;
@@ -1140,6 +1148,21 @@ int igmp6_event_query(struct sk_buff *sk
 		/* clear deleted report items */
 		mld_clear_delrec(idev);
 	} else if (len >= 28) {
+		int srcs_offset = sizeof(struct mld2_query) -
+			sizeof(struct icmp6hdr);
+		if (!pskb_may_pull(skb, srcs_offset)) {
+			in6_dev_put(idev);
+			return -EINVAL;
+		}
+		mlh2 = (struct mld2_query *) skb->h.raw;
+		if (mlh2->nsrcs != 0) {
+			if (!pskb_may_pull(skb, srcs_offset +
+				mlh2->nsrcs * sizeof(struct in6_addr))) {
+				in6_dev_put(idev);
+				return -EINVAL;
+			}
+			mlh2 = (struct mld2_query *) skb->h.raw;
+		}
 		max_delay = (MLDV2_MRC(ntohs(mlh2->mrc))*HZ)/1000;
 		if (!max_delay)
 			max_delay = 1;
@@ -1256,10 +1279,13 @@ static int is_in(struct ifmcaddr6 *pmc, 
 {
 	switch (type) {
 	case MLD2_MODE_IS_INCLUDE:
-	case MLD2_MODE_IS_EXCLUDE:
 		if (gdeleted || sdeleted)
 			return 0;
 		return !((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp);
+	case MLD2_MODE_IS_EXCLUDE:
+		if (gdeleted || sdeleted)
+			return 0;
+		return 1;
 	case MLD2_CHANGE_TO_INCLUDE:
 		if (gdeleted || sdeleted)
 			return 0;
@@ -1428,13 +1454,15 @@ static struct sk_buff *add_grec(struct s
 	struct mld2_report *pmr;
 	struct mld2_grec *pgr = NULL;
 	struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list;
-	int scount, first, isquery, truncate;
+	int scount, first, isquery, ischange, truncate;
 
 	if (pmc->mca_flags & MAF_NOREPORT)
 		return skb;
 
 	isquery = type == MLD2_MODE_IS_INCLUDE ||
 		  type == MLD2_MODE_IS_EXCLUDE;
+	ischange = type == MLD2_CHANGE_TO_INCLUDE ||
+		   type == MLD2_CHANGE_TO_EXCLUDE; 
 	truncate = type == MLD2_MODE_IS_EXCLUDE ||
 		    type == MLD2_CHANGE_TO_EXCLUDE;
 
@@ -1444,7 +1472,7 @@ static struct sk_buff *add_grec(struct s
 		if (type == MLD2_ALLOW_NEW_SOURCES ||
 		    type == MLD2_BLOCK_OLD_SOURCES)
 			return skb;
-		if (pmc->mca_crcount || isquery) {
+		if (ischange || isquery) {
 			/* make sure we have room for group header and at
 			 * least one source.
 			 */
@@ -1460,9 +1488,12 @@ static struct sk_buff *add_grec(struct s
 	pmr = skb ? (struct mld2_report *)skb->h.raw : NULL;
 
 	/* EX and TO_EX get a fresh packet, if needed */
-	if (truncate) {
-		if (pmr && pmr->ngrec &&
-		    AVAILABLE(skb) < grec_size(pmc, type, gdeleted, sdeleted)) {
+	if (truncate || ischange) {
+		int min_len;
+		min_len	= truncate ? grec_size(pmc, type, gdeleted, sdeleted) : 
+			  (sizeof(struct mld2_grec) + sizeof(struct in6_addr));
+		if (((pmr && pmr->ngrec) || ischange) &&
+		    AVAILABLE(skb) < min_len) {
 			if (skb)
 				mld_sendpack(skb);
 			skb = mld_newpack(dev, dev->mtu);
@@ -1471,6 +1502,10 @@ static struct sk_buff *add_grec(struct s
 	first = 1;
 	scount = 0;
 	psf_prev = NULL;
+	if (ischange) {
+		skb = add_grhead(skb, pmc, type, &pgr);
+		first = 0;
+	}
 	for (psf=*psf_list; psf; psf=psf_next) {
 		struct in6_addr *psrc;
 

^ permalink raw reply

* plaster Our company can fully satisfy all your needs for reproduction timepieces! took
From: andreas greaves @ 2005-11-02 13:46 UTC (permalink / raw)
  To: Cordell Puc; +Cc: linux-xfs, mendoza, netdev, schultz, cvs, murray


make heads turn by wearing one of this season's most coveted wholesale
repliica bags, watches or whatever luxury! Start shopping today and find out
why so many other women are choosing to carry our products year round. 
Addidas, Bally, Bvlgari, Burberry, Cartier, Chanel, Christian Dior,
Dunhill, Dupont, Escada, Fendi, Ferragamo, Gucci, Hermes, IWC, Jacob & Co.,
Louis Vuitton, Mont Blanc, Movado, Nike, Omega, Oris, Prada, Puma, Rado,
Roger Dubuis, Rolex, Sector, Tag Heuer, TechnoMarine, Tiffany, Timberland,
Tudor
dbpfqgfdn  http://uk.geocities.com/mespontaneitycoolba/?txdbccuvyxpu




At length the letter were disposed of, excepting one which he reserved for
a particular audience. Having locked the more confidential correspondence in
a drawer, Mr. Carker the Manager rang his bell. 
florenti  evangelos  directlow F3 cthuv  bundesrat
Mr. Dombey took it loosely in his own, and stood looking down upon her for
a moment, as if he knew as little as the child, what to say or do. 
`There. Be a good girl,' he said, patting her on the head, and regarding
her as it were by stealth with a disturbed and doubtful look. `Go to
Richards. Go.' 

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Marcelo Tosatti @ 2005-11-02 13:41 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: David Stevens, linux-kernel, netdev, Yan Zheng, David S. Miller
In-Reply-To: <20051102092959.GA15515@alpha.home.local>

On Wed, Nov 02, 2005 at 10:29:59AM +0100, Willy Tarreau wrote:
> On Tue, Nov 01, 2005 at 11:10:29PM -0800, David Stevens wrote:
> > Willy Tarreau <willy@w.ods.org> wrote on 11/01/2005 09:47:02 PM:
> > 
> > > Hi,
> > > 
> > > On Tue, Nov 01, 2005 at 06:37:43PM +0800, Yan Zheng wrote:
> > > > You can reproduce this bug by follow codes. This program will cause a
> > > > change to include report even though the first socket's filter mode is
> > > > exclude.
> > > 
> > > I've not clearly understood the nature of the bug, does it also
> > > affect 2.4 ? Marcelo will be releasing 2.4.32 in a few days, so
> > > it would be wise to merge the fix soon.
> > > 
> > > Regards,
> > > Willy
> > > 
> > 
> >         Yes.
> >  
> >         Multicast source filters aren't widely used yet, and that's
> > really the only feature that's affected if an application actually
> > exercises this bug, as far as I can tell. An ordinary filter-less
> > multicast join should still work, and only forwarded multicast
> > traffic making use of filters and doing empty-source filters with
> > the MSFILTER ioctl would be at risk of not getting multicast
> > traffic forwarded to them because the reports generated would not
> > be based on the correct counts.
> >         But having the fix in is better than having it broken, even
> > for that case. :-)
> 
> 
> OK, thanks for the clarification, I understand better now :-)
> 
> Marcelo, David, does this backport seem appropriate for 2.4.32 ? I verified
> that it compiles, nothing more. If it's OK, I've noticed another patch that
> Yan posted today and which might be of interest before a very solid release.

Hi Willy,

Given the fact that it is a bug correction, sure. 
Could you please prepare a nice e-mail with the full description?

Thanks

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Willy Tarreau @ 2005-11-02  9:29 UTC (permalink / raw)
  To: David Stevens
  Cc: linux-kernel, netdev, Yan Zheng, Marcelo Tosatti, David S. Miller
In-Reply-To: <OF0C913512.B3EB99A5-ON882570AD.0025FB9D-882570AD.00276427@us.ibm.com>

On Tue, Nov 01, 2005 at 11:10:29PM -0800, David Stevens wrote:
> Willy Tarreau <willy@w.ods.org> wrote on 11/01/2005 09:47:02 PM:
> 
> > Hi,
> > 
> > On Tue, Nov 01, 2005 at 06:37:43PM +0800, Yan Zheng wrote:
> > > You can reproduce this bug by follow codes. This program will cause a
> > > change to include report even though the first socket's filter mode is
> > > exclude.
> > 
> > I've not clearly understood the nature of the bug, does it also
> > affect 2.4 ? Marcelo will be releasing 2.4.32 in a few days, so
> > it would be wise to merge the fix soon.
> > 
> > Regards,
> > Willy
> > 
> 
>         Yes.
>  
>         Multicast source filters aren't widely used yet, and that's
> really the only feature that's affected if an application actually
> exercises this bug, as far as I can tell. An ordinary filter-less
> multicast join should still work, and only forwarded multicast
> traffic making use of filters and doing empty-source filters with
> the MSFILTER ioctl would be at risk of not getting multicast
> traffic forwarded to them because the reports generated would not
> be based on the correct counts.
>         But having the fix in is better than having it broken, even
> for that case. :-)


OK, thanks for the clarification, I understand better now :-)

Marcelo, David, does this backport seem appropriate for 2.4.32 ? I verified
that it compiles, nothing more. If it's OK, I've noticed another patch that
Yan posted today and which might be of interest before a very solid release.

Regards,
Willy

diff -urN linux-2.4.32-rc2/net/ipv4/igmp.c linux-2.4.32-rc2-mcast/net/ipv4/igmp.c
--- linux-2.4.32-rc2/net/ipv4/igmp.c	2005-11-02 10:16:03.000000000 +0100
+++ linux-2.4.32-rc2-mcast/net/ipv4/igmp.c	2005-11-02 10:20:33.000000000 +0100
@@ -1876,8 +1876,11 @@
 			sock_kfree_s(sk, newpsl, IP_SFLSIZE(newpsl->sl_max));
 			goto done;
 		}
-	} else
-		newpsl = 0;
+	} else {
+		newpsl = NULL;
+		(void) ip_mc_add_src(in_dev, &msf->imsf_multiaddr,
+		       msf->imsf_fmode, 0, NULL, 0);
+	}
 	psl = pmc->sflist;
 	if (psl) {
 		(void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
diff -urN linux-2.4.32-rc2/net/ipv6/mcast.c linux-2.4.32-rc2-mcast/net/ipv6/mcast.c
--- linux-2.4.32-rc2/net/ipv6/mcast.c	2005-11-02 10:16:03.000000000 +0100
+++ linux-2.4.32-rc2-mcast/net/ipv6/mcast.c	2005-11-02 10:21:49.000000000 +0100
@@ -505,8 +505,11 @@
 			sock_kfree_s(sk, newpsl, IP6_SFLSIZE(newpsl->sl_max));
 			goto done;
 		}
-	} else
-		newpsl = 0;
+	} else {
+		newpsl = NULL;
+		(void) ip6_mc_add_src(idev, group, gsf->gf_fmode, 0, NULL, 0);
+	}
+
 	psl = pmc->sflist;
 	if (psl) {
 		(void) ip6_mc_del_src(idev, group, pmc->sfmode,

^ permalink raw reply

* [2.6 patch] pktgen: remove useless assignment
From: Adrian Bunk @ 2005-11-02  9:11 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, Alexey Dobriyan

On main codepath pkt_dev is immediately rewritten. On error codepath it isn't
used.

Noticed by Coverity checker.

From: Alexey Dobriyan <adobriyan@gmail.com>

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-vanilla/net/core/pktgen.c
+++ linux-coverity-1762/net/core/pktgen.c
@@ -2882,7 +2882,7 @@ static int pktgen_add_device(struct pktg
 	
 	/* We don't allow a device to be on several threads */
 
-	if( (pkt_dev = __pktgen_NN_threads(ifname, FIND)) == NULL) {
+	if(__pktgen_NN_threads(ifname, FIND) == NULL) {
 						   
 		pkt_dev = kmalloc(sizeof(struct pktgen_dev), GFP_KERNEL);
                 if (!pkt_dev) 

^ permalink raw reply

* [PATCH][MCAST]Two fix for implementation of MLDv2 .
From: Yan Zheng @ 2005-11-02  8:29 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, David Stevens

Hi.
I find two bug yesterday when I was thinking whether ip6_mc_del_src(...) should be called in __ipv6_dev_mc_dec(...).


The first change in function is_in(...) is to make process Multicast Address and Source Specific Query same as Multicast Address Specific Query.
Although it still doesn't satisfy the requirement in rfc3810, but not at risk of losing multicast traffic.
For example:
A Node's filter for Multicast address M is EXCLUDE (X,Y) and receice a Multicast Address and Source Specific Query Q(M,Z).
Without the change No report will send to router, so the node may get multicast traffic from address Z lost.


The second change in function add_grec(...) is to make sure Mode Change Report send properly.
When A filter's source address list is not empty, but none of them can be included in report.


Regards


Signed-off-by: Yan Zheng <yanzheng@21cn.com>

Index:net/ipv6/mcast.c
============================================================
--- linux-2.6.14/net/ipv6/mcast.c	2005-10-30 23:09:33.000000000 +0800
+++ linux/net/ipv6/mcast.c	2005-11-02 15:01:28.000000000 +0800
@@ -1256,10 +1256,13 @@ static int is_in(struct ifmcaddr6 *pmc, 
 {
 	switch (type) {
 	case MLD2_MODE_IS_INCLUDE:
-	case MLD2_MODE_IS_EXCLUDE:
 		if (gdeleted || sdeleted)
 			return 0;
 		return !((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp);
+	case MLD2_MODE_IS_EXCLUDE:
+		if (gdeleted || sdeleted)
+			return 0;
+		return 1;
 	case MLD2_CHANGE_TO_INCLUDE:
 		if (gdeleted || sdeleted)
 			return 0;
@@ -1428,13 +1431,15 @@ static struct sk_buff *add_grec(struct s
 	struct mld2_report *pmr;
 	struct mld2_grec *pgr = NULL;
 	struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list;
-	int scount, first, isquery, truncate;
+	int scount, first, isquery, ischange, truncate;
 
 	if (pmc->mca_flags & MAF_NOREPORT)
 		return skb;
 
 	isquery = type == MLD2_MODE_IS_INCLUDE ||
 		  type == MLD2_MODE_IS_EXCLUDE;
+	ischange = type == MLD2_CHANGE_TO_INCLUDE ||
+		   type == MLD2_CHANGE_TO_EXCLUDE; 
 	truncate = type == MLD2_MODE_IS_EXCLUDE ||
 		    type == MLD2_CHANGE_TO_EXCLUDE;
 
@@ -1444,7 +1449,7 @@ static struct sk_buff *add_grec(struct s
 		if (type == MLD2_ALLOW_NEW_SOURCES ||
 		    type == MLD2_BLOCK_OLD_SOURCES)
 			return skb;
-		if (pmc->mca_crcount || isquery) {
+		if (ischange || isquery) {
 			/* make sure we have room for group header and at
 			 * least one source.
 			 */
@@ -1460,9 +1465,12 @@ static struct sk_buff *add_grec(struct s
 	pmr = skb ? (struct mld2_report *)skb->h.raw : NULL;
 
 	/* EX and TO_EX get a fresh packet, if needed */
-	if (truncate) {
-		if (pmr && pmr->ngrec &&
-		    AVAILABLE(skb) < grec_size(pmc, type, gdeleted, sdeleted)) {
+	if (truncate || ischange) {
+		int min_len;
+		min_len	= truncate ? grec_size(pmc, type, gdeleted, sdeleted) : 
+			  (sizeof(struct mld2_grec) + sizeof(struct in6_addr));
+		if (((pmr && pmr->ngrec) || ischange) &&
+		    AVAILABLE(skb) < min_len) {
 			if (skb)
 				mld_sendpack(skb);
 			skb = mld_newpack(dev, dev->mtu);
@@ -1471,6 +1479,10 @@ static struct sk_buff *add_grec(struct s
 	first = 1;
 	scount = 0;
 	psf_prev = NULL;
+	if (ischange) {
+		skb = add_grhead(skb, pmc, type, &pgr);
+		first = 0;
+	}
 	for (psf=*psf_list; psf; psf=psf_next) {
 		struct in6_addr *psrc;
 

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: David Stevens @ 2005-11-02  7:10 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: linux-kernel, netdev, Yan Zheng
In-Reply-To: <20051102054702.GB11266@alpha.home.local>

Willy Tarreau <willy@w.ods.org> wrote on 11/01/2005 09:47:02 PM:

> Hi,
> 
> On Tue, Nov 01, 2005 at 06:37:43PM +0800, Yan Zheng wrote:
> > You can reproduce this bug by follow codes. This program will cause a
> > change to include report even though the first socket's filter mode is
> > exclude.
> 
> I've not clearly understood the nature of the bug, does it also
> affect 2.4 ? Marcelo will be releasing 2.4.32 in a few days, so
> it would be wise to merge the fix soon.
> 
> Regards,
> Willy
> 

        Yes.
 
        Multicast source filters aren't widely used yet, and that's
really the only feature that's affected if an application actually
exercises this bug, as far as I can tell. An ordinary filter-less
multicast join should still work, and only forwarded multicast
traffic making use of filters and doing empty-source filters with
the MSFILTER ioctl would be at risk of not getting multicast
traffic forwarded to them because the reports generated would not
be based on the correct counts.
        But having the fix in is better than having it broken, even
for that case. :-)

                                                        +-DLS

^ permalink raw reply

* Re: ancient ieee80211/ipw2200 drivers in recent kernel (2.6.14)
From: Mikhail Gusarov @ 2005-11-02  6:54 UTC (permalink / raw)
  To: Mikhail Gusarov; +Cc: debian-kernel, NetDev
In-Reply-To: <20051102020903.GG29803@verge.net.au>


You (horms@verge.net.au) wrote:

 >> I've encountered the problem with 2.6.14 kernels: they are shipped
 >> with ancient version of ipw2200 drivers (1.0.0 while current
 >> version is 1.0.7) and ancient version of ieee80211 subsystem
 >> (copyrighted as 2004, so also outdated).
 >> 
 >> This breaks compilation of module from ipw2200-source package
 >> (because it links against in-kernel ieee80211).

 H> I assume the problem you are seeing is a headers problem.

Ah, yes. The other problem is two copies ipw2200.ko & ieee80211*.ko
modules being installed: the ones included in kernel and others
compiled as external modules. I suppose this may lead to the problems
with depmod.

 >> Is there way to modularize builds to exclude ieee80211 or just
 >> disable it (along with ipw2200) because it is outdated and current
 >> vesion is shipped in ieee80211-source package?

 H> Probably the best place to start is to ping netdev to find out if
 H> there are any plans to update IPW2200 in Linus's tree. I've CCed
 H> that list, hopefully someone can shed some light on this.

So, having in mind the two levels of 'stablenesss': kernel
'stableness' and modules 'stableness' :) we should find the way to
exclude discussed modules from the build, because in-kernel versions
will always be, erm..., slightly (1.0.0 is mentioned only as 'stone
age' in the mailing list of ipw2200 developers) outdated due to fact
integration and testing gets some time in upstream kernels. I propose
just to disable compilation of this drivers: everyone will be able to
compile the recent version using ipw2200-source we provide.

-- 
Mikhail Gusarov
ICQ UIN: 111575219
JID: dottedmag@jabber.dottedmag.net

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Willy Tarreau @ 2005-11-02  5:47 UTC (permalink / raw)
  To: Yan Zheng; +Cc: netdev, linux-kernel, David Stevens
In-Reply-To: <7e77d27c0511010237x775529b8h@mail.gmail.com>

Hi,

On Tue, Nov 01, 2005 at 06:37:43PM +0800, Yan Zheng wrote:
> You can reproduce this bug by follow codes. This program will cause a
> change to include report even though the first socket's filter mode is
> exclude.

I've not clearly understood the nature of the bug, does it also
affect 2.4 ? Marcelo will be releasing 2.4.32 in a few days, so
it would be wise to merge the fix soon.

Regards,
Willy

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox