b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Always initialize fragment header priority
@ 2017-11-29  9:25 Sven Eckelmann
  2017-12-01 11:31 ` Sven Eckelmann
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2017-11-29  9:25 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann, Andrew Lunn

From: Sven Eckelmann <sven.eckelmann@open-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: 4f241fcea704 ("batman-adv: Include frame priority in fragment header")
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
---
Cc: Andrew Lunn <andrew@lunn.ch>
---
 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 a98cf1104a30a30e66fb6018bef59dea83dc4b7a..ebe6e38934e46ed5de4d30204e791dbe40285fcc 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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Always initialize fragment header priority
  2017-11-29  9:25 [B.A.T.M.A.N.] [PATCH] batman-adv: Always initialize fragment header priority Sven Eckelmann
@ 2017-12-01 11:31 ` Sven Eckelmann
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Eckelmann @ 2017-12-01 11:31 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

On Mittwoch, 29. November 2017 10:25:02 CET Sven Eckelmann wrote:
> From: Sven Eckelmann <sven.eckelmann@open-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: 4f241fcea704 ("batman-adv: Include frame priority in fragment header")
> Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
> ---
> Cc: Andrew Lunn <andrew@lunn.ch>

Applied in e45a75c82fea [1]

Kind regards,
	Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/e45a75c82feae23a20d2744ccfde03780ccdafc7

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-01 11:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-29  9:25 [B.A.T.M.A.N.] [PATCH] batman-adv: Always initialize fragment header priority Sven Eckelmann
2017-12-01 11:31 ` Sven Eckelmann

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).