From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alexander Aring <alex.aring@gmail.com>
Cc: linux-wpan@vger.kernel.org
Subject: [patch] ieee802154: || vs && in ieee802154_is_valid_extended_addr()
Date: Tue, 4 Nov 2014 11:55:09 +0300 [thread overview]
Message-ID: <20141104085509.GA12954@mwanda> (raw)
In-Reply-To: <20141104000139.GA23799@omega>
The ieee802154_is_valid_extended_addr() always returns true because
there is a typo. The || should be &&. Neither 0x0000000000000000ULL
nor 0xffffffffffffffffULL are valid addresses.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/include/linux/ieee802154.h b/include/linux/ieee802154.h
index 5d9e745..4c03286 100644
--- a/include/linux/ieee802154.h
+++ b/include/linux/ieee802154.h
@@ -209,7 +209,7 @@ static inline bool ieee802154_is_valid_extended_addr(const __le64 addr)
* This is currently a workaround because neighbor discovery can't
* deal with short addresses types right now.
*/
- return ((addr != cpu_to_le64(0x0000000000000000ULL)) ||
+ return ((addr != cpu_to_le64(0x0000000000000000ULL)) &&
(addr != cpu_to_le64(0xffffffffffffffffULL)));
}
next prev parent reply other threads:[~2014-11-04 8:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 20:41 ieee802154: add extended address validation helper Dan Carpenter
2014-11-04 0:01 ` Alexander Aring
2014-11-04 8:55 ` Dan Carpenter [this message]
2014-11-04 9:12 ` [patch] ieee802154: || vs && in ieee802154_is_valid_extended_addr() Alexander Aring
2014-11-04 16:45 ` Marcel Holtmann
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=20141104085509.GA12954@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alex.aring@gmail.com \
--cc=linux-wpan@vger.kernel.org \
/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.