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 Saturday 26 January 2008, Michael Buesch wrote:
> On Saturday 26 January 2008 22:38:18 Helge Deller wrote:
> > use is_valid_ether_addr() macro instead of hand-coded checks for 
> > valid IP address.
> > 
> 
> > diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
> > index 42a36b3..7251e71 100644
> > --- a/drivers/net/wireless/wl3501_cs.c
> > +++ b/drivers/net/wireless/wl3501_cs.c
> > @@ -1577,13 +1577,12 @@ static int wl3501_set_wap(struct net_device *dev, struct iw_request_info *info,
> >  			  union iwreq_data *wrqu, char *extra)
> >  {
> >  	struct wl3501_card *this = netdev_priv(dev);
> > -	static const u8 bcast[ETH_ALEN] = { 255, 255, 255, 255, 255, 255 };
> >  	int rc = -EINVAL;
> >  
> >  	/* FIXME: we support other ARPHRDs...*/
> >  	if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
> >  		goto out;
> > -	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.

Helge
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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