diff options
author | Sven Eckelmann <sven.eckelmann@open-mesh.com> | 2020-03-17 01:30:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-20 12:54:20 +0300 |
commit | 1c2139faa923dcdd75f58e68959422c8475fd58f (patch) | |
tree | d48fa678bb617553157514729f9486355db7c549 | |
parent | c408b35da8ef4378b858d3f9f33f23a16989676b (diff) | |
download | linux-1c2139faa923dcdd75f58e68959422c8475fd58f.tar.xz |
batman-adv: Always initialize fragment header priority
commit fe77d8257c4d838c5976557ddb87bd789f312412 upstream.
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@open-mesh.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/batman-adv/fragmentation.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c index c6d37d22bd12..788d62073964 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c @@ -500,6 +500,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); |