[1/2] batman-adv: Set skb priority in fragments

Message ID 1462817016-17867-2-git-send-email-andrew@lunn.ch (mailing list archive)
State Accepted, archived
Delegated to: Marek Lindner
Headers

Commit Message

Andrew Lunn May 9, 2016, 6:03 p.m. UTC
  BATMAN will set the skb->priority based on the IP precedence or 802.1q
tag. However, if it needs to fragment the frame, it currently leaves
the fragment skb with the default priority and actually overwrites the
priority in the unfragmented frame. Fix this.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 net/batman-adv/fragmentation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Sven Eckelmann May 11, 2016, 6:21 a.m. UTC | #1
On Monday 09 May 2016 20:03:35 Andrew Lunn wrote:
> BATMAN will set the skb->priority based on the IP precedence or 802.1q
> tag. However, if it needs to fragment the frame, it currently leaves
> the fragment skb with the default priority and actually overwrites the
> priority in the unfragmented frame. Fix this.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  net/batman-adv/fragmentation.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
> index 65536db..a3fefbd 100644
> --- a/net/batman-adv/fragmentation.c
> +++ b/net/batman-adv/fragmentation.c
> @@ -414,7 +414,7 @@ static struct sk_buff *batadv_frag_create(struct sk_buff *skb,
>  	if (!skb_fragment)
>  		goto err;
>  
> -	skb->priority = TC_PRIO_CONTROL;
> +	skb_fragment->priority = skb->priority;
>  
>  	/* Eat the last mtu-bytes of the skb */
>  	skb_reserve(skb_fragment, header_size + ETH_HLEN);
> 

Please remove linux/pkt_sched.h in fragmentation.c because it is only
used for TC_PRIO_CONTROL in master.

Kind regards,
	Sven
  
Marek Lindner May 11, 2016, 8:06 a.m. UTC | #2
On Monday, May 09, 2016 20:03:35 Andrew Lunn wrote:
> BATMAN will set the skb->priority based on the IP precedence or 802.1q
> tag. However, if it needs to fragment the frame, it currently leaves
> the fragment skb with the default priority and actually overwrites the
> priority in the unfragmented frame. Fix this.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  net/batman-adv/fragmentation.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied in revision e374d75.

Thanks,
Marek
  

Patch

diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index 65536db..a3fefbd 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -414,7 +414,7 @@  static struct sk_buff *batadv_frag_create(struct sk_buff *skb,
 	if (!skb_fragment)
 		goto err;
 
-	skb->priority = TC_PRIO_CONTROL;
+	skb_fragment->priority = skb->priority;
 
 	/* Eat the last mtu-bytes of the skb */
 	skb_reserve(skb_fragment, header_size + ETH_HLEN);