All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Michael Buesch <mb@bu3sch.de>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] use is_valid_ether_addr() macro in wireless drivers
Date: Sat, 26 Jan 2008 22:52:22 +0100	[thread overview]
Message-ID: <200801262252.22626.deller@gmx.de> (raw)
In-Reply-To: <200801262245.40184.mb@bu3sch.de>

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

  reply	other threads:[~2008-01-26 21:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-26 21:38 [PATCH] use is_valid_ether_addr() macro in wireless drivers Helge Deller
2008-01-26 21:45 ` Michael Buesch
2008-01-26 21:52   ` Helge Deller [this message]
2008-01-29 16:29 ` 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=200801262252.22626.deller@gmx.de \
    --to=deller@gmx.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mb@bu3sch.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.