Search Linux Wireless

Re: [PATCH] use is_valid_ether_addr() macro in wireless drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2008-01-26 at 22:38 +0100, Helge Deller wrote:
> use is_valid_ether_addr() macro instead of hand-coded checks for 
> valid IP address.

Ahem. IP addresses? In any case, this patch is totally bogus, these are
not checks for invalid MAC addresses but rather a check for the special
any/off addresses. Please read the iwconfig man page.

> -	else if (!memcmp(any, awrq->sa_data, ETH_ALEN) ||
> -	         !memcmp(off, awrq->sa_data, ETH_ALEN)) {
> +	else if (!is_valid_ether_addr(awrq->sa_data)) {

NACK anyway. These adresses ("any", "off") are actually special for
wext, this has nothing to do whether they are invalid or not.

> > > -   if (!memcmp(bcast, wrqu->ap_addr.sa_data, ETH_ALEN)) {
> > > +   if (!is_valid_ether_addr(wrqu->ap_addr.sa_data)) {
> > >             /* FIXME: rescan? */
> > >     } else
> > >             memcpy(this->bssid, wrqu->ap_addr.sa_data, ETH_ALEN);
> > 
> > This is a semantical change.
> > If the original code is correct, this should be
> is_broadcast_ether_addr()
> 
> Yes, but the original code is probably wrong.
> So I think my patch fixes a bug here as well.

Not at all. Yes, it is unfortunate that drivers have to have this
knowledge about wext internals, but that's how wext is designed.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux