summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/fragmentation.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-05-09 20:03:36 +0200
committerSimon Wunderlich <sw@simonwunderlich.de>2016-06-30 10:29:43 +0200
commitc0f25c802b3300b28d1e67c58c702d29555838de (patch)
treef27c5176ee6786757fb43e522ed45d230bbfce60 /net/batman-adv/fragmentation.c
parent1914848e0d641f8d6173bb53b6a4a392468ac725 (diff)
downloadtalos-obmc-linux-c0f25c802b3300b28d1e67c58c702d29555838de.tar.gz
talos-obmc-linux-c0f25c802b3300b28d1e67c58c702d29555838de.zip
batman-adv: Include frame priority in fragment header
Unfragmented frames which traverse a node have their skb->priority set by looking at the IP ToS byte, or the 802.1p header. However for fragments this is not possible, only one of the fragments will contain the headers. Instead, place the priority into the fragment header and on receiving a fragment, use this information to set the skb->priority for when the fragment is forwarded. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/fragmentation.c')
-rw-r--r--net/batman-adv/fragmentation.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index a119b6a6365f..9f41a0a0d6ab 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -472,6 +472,15 @@ bool batadv_frag_send_packet(struct sk_buff *skb,
frag_header.reserved = 0;
frag_header.no = 0;
frag_header.total_size = htons(skb->len);
+
+ /* skb->priority values from 256->263 are magic values to
+ * directly indicate a specific 802.1d priority. This is used
+ * to allow 802.1d priority to be passed directly in from VLAN
+ * tags, etc.
+ */
+ if (skb->priority >= 256 && skb->priority <= 263)
+ frag_header.priority = skb->priority - 256;
+
ether_addr_copy(frag_header.orig, primary_if->net_dev->dev_addr);
ether_addr_copy(frag_header.dest, orig_node->orig);
OpenPOWER on IntegriCloud