From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH v3 2/3] batman-adv: Disallow zero and mcast src address for mgmt frames
Date: Sat, 6 Aug 2016 17:04:22 +0200 [thread overview]
Message-ID: <1470495863-22251-2-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <1470495863-22251-1-git-send-email-sven@narfation.org>
The routing check for management frames is validating the source mac
address in the outer ethernet header. It rejects every source mac address
which is a broadcast address. But it also has to reject the zero-mac
address and multicast mac addresses.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
v3:
- Fix patch subject
v2:
- clarify in commit message that only the outer ethernet header is
affected
(thanks Linus)
- split in patch 1/2
---
net/batman-adv/routing.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 913ab51..e2b91e6 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -196,8 +196,8 @@ bool batadv_check_management_packet(struct sk_buff *skb,
if (!is_broadcast_ether_addr(ethhdr->h_dest))
return false;
- /* packet with broadcast sender address */
- if (is_broadcast_ether_addr(ethhdr->h_source))
+ /* packet with invalid sender address */
+ if (!is_valid_ether_addr(ethhdr->h_source))
return false;
/* create a copy of the skb, if needed, to modify it. */
--
2.8.1
next prev parent reply other threads:[~2016-08-06 15:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-06 15:04 [B.A.T.M.A.N.] [PATCH v3 1/3] batman-adv: Disallow mcast src address for data frames Sven Eckelmann
2016-08-06 15:04 ` Sven Eckelmann [this message]
2016-08-06 15:04 ` [B.A.T.M.A.N.] [PATCH v3 3/3] batman-adv: Reject unicast packet with zero/mcast dst address Sven Eckelmann
2016-10-24 10:10 ` [B.A.T.M.A.N.] [PATCH v3 1/3] batman-adv: Disallow mcast src address for data frames Simon Wunderlich
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=1470495863-22251-2-git-send-email-sven@narfation.org \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).