diff options
author | Sven Eckelmann <sven.eckelmann@open-mesh.com> | 2017-11-29 04:25:02 -0500 |
---|---|---|
committer | Simon Wunderlich <sw@simonwunderlich.de> | 2017-12-01 06:37:58 -0500 |
commit | fe77d8257c4d838c5976557ddb87bd789f312412 (patch) | |
tree | edb927db4a73a72df91bdde4b315222dffdf8f73 /net/batman-adv/fragmentation.c | |
parent | 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff) |
batman-adv: Always initialize fragment header priority
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>
Diffstat (limited to 'net/batman-adv/fragmentation.c')
-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 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, | |||
499 | */ | 499 | */ |
500 | if (skb->priority >= 256 && skb->priority <= 263) | 500 | if (skb->priority >= 256 && skb->priority <= 263) |
501 | frag_header.priority = skb->priority - 256; | 501 | frag_header.priority = skb->priority - 256; |
502 | else | ||
503 | frag_header.priority = 0; | ||
502 | 504 | ||
503 | ether_addr_copy(frag_header.orig, primary_if->net_dev->dev_addr); | 505 | ether_addr_copy(frag_header.orig, primary_if->net_dev->dev_addr); |
504 | ether_addr_copy(frag_header.dest, orig_node->orig); | 506 | ether_addr_copy(frag_header.dest, orig_node->orig); |