Commit 3308de2b841e5f25bdc4a7208a451f52f8cff969

Authored by Florent Fourcot
Committed by David S. Miller
1 parent 82e9f105a2

ipv6: add ip6_flowlabel helper

And use it if possible.

Signed-off-by: Florent Fourcot <florent.fourcot@enst-bretagne.fr>
Reviewed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 3 changed files with 7 additions and 2 deletions Side-by-side Diff

... ... @@ -679,6 +679,11 @@
679 679 return *(__be32 *)hdr & IPV6_FLOWINFO_MASK;
680 680 }
681 681  
  682 +static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr)
  683 +{
  684 + return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK;
  685 +}
  686 +
682 687 /*
683 688 * Prototypes exported by ipv6
684 689 */
... ... @@ -845,7 +845,7 @@
845 845 if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
846 846 fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK);
847 847 if (t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL)
848   - fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_FLOWLABEL_MASK);
  848 + fl6.flowlabel |= ip6_flowlabel(ipv6h);
849 849 if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
850 850 fl6.flowi6_mark = skb->mark;
851 851  
net/ipv6/ip6_tunnel.c
... ... @@ -1130,7 +1130,7 @@
1130 1130 if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
1131 1131 fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK);
1132 1132 if (t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL)
1133   - fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_FLOWLABEL_MASK);
  1133 + fl6.flowlabel |= ip6_flowlabel(ipv6h);
1134 1134 if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
1135 1135 fl6.flowi6_mark = skb->mark;
1136 1136