netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, kbuild test robot <lkp@intel.com>
Subject: Re: [PATCH net v2 1/2] ipv6: constify rt6_nexthop()
Date: Mon, 24 Jun 2019 09:45:14 -0700	[thread overview]
Message-ID: <CAKwvOdk9yxnO_2yDwuG8ECw2o8kP=w8pvdbCqDuwO4_03rj5gw@mail.gmail.com> (raw)
In-Reply-To: <20190624140109.14775-2-nicolas.dichtel@6wind.com>

On Mon, Jun 24, 2019 at 7:01 AM Nicolas Dichtel
<nicolas.dichtel@6wind.com> wrote:
>
> There is no functional change in this patch, it only prepares the next one.
>
> rt6_nexthop() will be used by ip6_dst_lookup_neigh(), which uses const
> variables.
>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Also, I think this fixes an issues reported by 0day:
https://groups.google.com/forum/#!searchin/clang-built-linux/const%7Csort:date/clang-built-linux/umkS84jS9m8/GAVVEgNYBgAJ

Reported-by: kbuild test robot <lkp@intel.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  drivers/net/vrf.c                | 2 +-
>  include/net/ip6_route.h          | 4 ++--
>  net/bluetooth/6lowpan.c          | 4 ++--
>  net/ipv6/ip6_output.c            | 2 +-
>  net/netfilter/nf_flow_table_ip.c | 2 +-
>  5 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
> index 11b9525dff27..311b0cc6eb98 100644
> --- a/drivers/net/vrf.c
> +++ b/drivers/net/vrf.c
> @@ -350,8 +350,8 @@ static int vrf_finish_output6(struct net *net, struct sock *sk,
>  {
>         struct dst_entry *dst = skb_dst(skb);
>         struct net_device *dev = dst->dev;
> +       const struct in6_addr *nexthop;
>         struct neighbour *neigh;
> -       struct in6_addr *nexthop;
>         int ret;
>
>         nf_reset(skb);
> diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
> index 4790beaa86e0..ee7405e759ba 100644
> --- a/include/net/ip6_route.h
> +++ b/include/net/ip6_route.h
> @@ -262,8 +262,8 @@ static inline bool ip6_sk_ignore_df(const struct sock *sk)
>                inet6_sk(sk)->pmtudisc == IPV6_PMTUDISC_OMIT;
>  }
>
> -static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt,
> -                                          struct in6_addr *daddr)
> +static inline const struct in6_addr *rt6_nexthop(const struct rt6_info *rt,
> +                                                const struct in6_addr *daddr)
>  {
>         if (rt->rt6i_flags & RTF_GATEWAY)
>                 return &rt->rt6i_gateway;
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index 19d27bee285e..1555b0c6f7ec 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -160,10 +160,10 @@ static inline struct lowpan_peer *peer_lookup_dst(struct lowpan_btle_dev *dev,
>                                                   struct in6_addr *daddr,
>                                                   struct sk_buff *skb)
>  {
> -       struct lowpan_peer *peer;
> -       struct in6_addr *nexthop;
>         struct rt6_info *rt = (struct rt6_info *)skb_dst(skb);
>         int count = atomic_read(&dev->peer_count);
> +       const struct in6_addr *nexthop;
> +       struct lowpan_peer *peer;

I see the added const, but I'm not sure why the declarations were
reordered?  Here and below. Doesn't matter for code review (doesn't
necessitate a v2).

>
>         BT_DBG("peers %d addr %pI6c rt %p", count, daddr, rt);
>
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index 834475717110..21efcd02f337 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -59,8 +59,8 @@ static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *
>  {
>         struct dst_entry *dst = skb_dst(skb);
>         struct net_device *dev = dst->dev;
> +       const struct in6_addr *nexthop;
>         struct neighbour *neigh;
> -       struct in6_addr *nexthop;
>         int ret;
>
>         if (ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr)) {
> diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
> index 241317473114..cdfc33517e85 100644
> --- a/net/netfilter/nf_flow_table_ip.c
> +++ b/net/netfilter/nf_flow_table_ip.c
> @@ -439,9 +439,9 @@ nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb,
>         struct nf_flowtable *flow_table = priv;
>         struct flow_offload_tuple tuple = {};
>         enum flow_offload_tuple_dir dir;
> +       const struct in6_addr *nexthop;
>         struct flow_offload *flow;
>         struct net_device *outdev;
> -       struct in6_addr *nexthop;
>         struct ipv6hdr *ip6h;
>         struct rt6_info *rt;
>
> --
> 2.21.0
>


-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2019-06-24 16:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 12:34 [PATCH net] ipv6: fix neighbour resolution with raw socket Nicolas Dichtel
2019-06-20 15:12 ` David Ahern
2019-06-20 15:42   ` Nicolas Dichtel
2019-06-20 16:36     ` David Ahern
2019-06-20 16:47       ` David Ahern
2019-06-21  8:09       ` Nicolas Dichtel
2019-06-21 18:48 ` kbuild test robot
2019-06-23  0:07 ` David Miller
2019-06-23  0:08   ` David Miller
2019-06-24 14:01     ` [PATCH net v2 0/2] " Nicolas Dichtel
2019-06-24 14:01       ` [PATCH net v2 1/2] ipv6: constify rt6_nexthop() Nicolas Dichtel
2019-06-24 16:45         ` Nick Desaulniers [this message]
2019-06-24 17:06           ` David Miller
2019-06-24 17:17             ` Nick Desaulniers
2019-06-24 17:22               ` David Miller
2019-06-24 17:37                 ` Nick Desaulniers
2019-06-24 18:18                   ` Nicolas Dichtel
2019-06-24 20:27                     ` David Miller
2019-06-24 14:01       ` [PATCH net v2 2/2] ipv6: fix neighbour resolution with raw socket Nicolas Dichtel
2019-06-26 20:26       ` [PATCH net v2 0/2] " David Miller
2019-10-14  9:34         ` Nicolas Dichtel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKwvOdk9yxnO_2yDwuG8ECw2o8kP=w8pvdbCqDuwO4_03rj5gw@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=davem@davemloft.net \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).