[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171215113143.12852-2-sw@simonwunderlich.de>
Date: Fri, 15 Dec 2017 12:31:40 +0100
From: Simon Wunderlich <sw@...onwunderlich.de>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, b.a.t.m.a.n@...ts.open-mesh.org,
Sven Eckelmann <sven.eckelmann@...n-mesh.com>,
Simon Wunderlich <sw@...onwunderlich.de>
Subject: [PATCH 1/4] batman-adv: Always initialize fragment header priority
From: Sven Eckelmann <sven.eckelmann@...n-mesh.com>
The batman-adv unuicast fragment header contains 3 bits for the priority of
the packet. These bits will be initialized when the skb->priority contains
a value between 256 and 263. But otherwise, the uninitialized bits from the
stack will be used.
Fixes: c0f25c802b33 ("batman-adv: Include frame priority in fragment header")
Signed-off-by: Sven Eckelmann <sven.eckelmann@...n-mesh.com>
Signed-off-by: Simon Wunderlich <sw@...onwunderlich.de>
---
net/batman-adv/fragmentation.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index a98cf1104a30..ebe6e38934e4 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -499,6 +499,8 @@ int batadv_frag_send_packet(struct sk_buff *skb,
*/
if (skb->priority >= 256 && skb->priority <= 263)
frag_header.priority = skb->priority - 256;
+ else
+ frag_header.priority = 0;
ether_addr_copy(frag_header.orig, primary_if->net_dev->dev_addr);
ether_addr_copy(frag_header.dest, orig_node->orig);
--
2.11.0
Powered by blists - more mailing lists