[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJFZqHwLap==WKDAwtPeL+oUOtvJ+j7S8VJBUDXV-Q7_21Jx2Q@mail.gmail.com>
Date: Thu, 9 Jan 2014 18:18:48 +0800
From: RongQing Li <roy.qing.li@...il.com>
To: netdev@...r.kernel.org
Subject: Re: [PATCH net-next] ipv6: move IPV6_TCLASS_SHIFT into ipv6.h
On Wed, Jan 8, 2014 at 5:37 PM, <roy.qing.li@...il.com> wrote:
> From: Li RongQing <roy.qing.li@...il.com>
>
> Two places defined IPV6_TCLASS_SHIFT, so we should move it into ipv6.h,
> and use this macro as possible.
>
> Signed-off-by: Li RongQing <roy.qing.li@...il.com>
> ---
> include/net/ipv6.h | 1 +
> net/ipv6/fib6_rules.c | 4 +++-
> net/ipv6/ip6_gre.c | 2 --
> net/ipv6/ip6_tunnel.c | 2 --
> net/ipv6/ipv6_sockglue.c | 4 +++-
> 5 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/include/net/ipv6.h b/include/net/ipv6.h
> index 12079c6..d819f7a 100644
> --- a/include/net/ipv6.h
> +++ b/include/net/ipv6.h
> @@ -239,6 +239,7 @@ struct ip6_flowlabel {
> #define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF)
> #define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF)
> #define IPV6_TCLASS_MASK (IPV6_FLOWINFO_MASK & ~IPV6_FLOWLABEL_MASK)
> +#define IPV6_TCLASS_SHIFT 20
>
> struct ipv6_fl_socklist {
> struct ipv6_fl_socklist __rcu *next;
> diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
> index 3fd0a57..d50c5ca 100644
> --- a/net/ipv6/fib6_rules.c
> +++ b/net/ipv6/fib6_rules.c
> @@ -150,6 +150,8 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
> {
> struct fib6_rule *r = (struct fib6_rule *) rule;
> struct flowi6 *fl6 = &fl->u.ip6;
> + u8 tclass = (ntohl(fl6->flowlabel) & IPV6_TCLASS_MASK) >>
> + IPV6_TCLASS_SHIFT;
Please drop this patch, it has bug.
The correct should be:
u8 tclass =ntohl(fl6->flowlabe & IPV6_TCLASS_MASK) >> IPV6_TCLASS_SHIFT
Thanks
-Roy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists