From patchwork Sun Dec 8 14:47:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florent Fourcot X-Patchwork-Id: 298837 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3A8352C0086 for ; Mon, 9 Dec 2013 01:47:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759280Ab3LHOrP (ORCPT ); Sun, 8 Dec 2013 09:47:15 -0500 Received: from fourcot.fr ([217.70.191.14]:57313 "EHLO olfflo.fourcot.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756025Ab3LHOrO (ORCPT ); Sun, 8 Dec 2013 09:47:14 -0500 Received: from reglisse.fourcot.fr (unknown [IPv6:2001:470:51a3:666:5616:63f8:177d:ce1]) (Authenticated sender: reglisse) by olfflo.fourcot.fr (Postfix) with ESMTPSA id 2138A2E447; Sun, 8 Dec 2013 15:47:13 +0100 (CET) Received: by reglisse.fourcot.fr (Postfix, from userid 1000) id 81DB477D5BC; Sun, 8 Dec 2013 15:47:12 +0100 (CET) From: Florent Fourcot To: netdev@vger.kernel.org Cc: Florent Fourcot Subject: [PATCH net-next 4/5] ipv6: add ip6_flowlabel helper Date: Sun, 8 Dec 2013 15:47:00 +0100 Message-Id: <1386514021-11646-4-git-send-email-florent.fourcot@enst-bretagne.fr> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1386514021-11646-1-git-send-email-florent.fourcot@enst-bretagne.fr> References: <1386514021-11646-1-git-send-email-florent.fourcot@enst-bretagne.fr> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org And use it if possible. Signed-off-by: Florent Fourcot Reviewed-by: Hannes Frederic Sowa --- include/net/ipv6.h | 5 +++++ net/ipv6/ip6_gre.c | 2 +- net/ipv6/ip6_tunnel.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/net/ipv6.h b/include/net/ipv6.h index f0edf00..ff196b2 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -678,6 +678,11 @@ static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr) return *(__be32 *)hdr & IPV6_FLOWINFO_MASK; } +static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr) +{ + return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK; +} + /* * Prototypes exported by ipv6 */ diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index c50de06..e27fb78 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -845,7 +845,7 @@ static inline int ip6gre_xmit_ipv6(struct sk_buff *skb, struct net_device *dev) if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS) fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK); if (t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL) - fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_FLOWLABEL_MASK); + fl6.flowlabel |= ip6_flowlabel(ipv6h); if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) fl6.flowi6_mark = skb->mark; diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index f5e8a98..8d7c986 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1130,7 +1130,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS) fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK); if (t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL) - fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_FLOWLABEL_MASK); + fl6.flowlabel |= ip6_flowlabel(ipv6h); if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) fl6.flowi6_mark = skb->mark;