]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ipv6: constify rt6_nexthop()
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Fri, 6 Sep 2019 09:54:00 +0000 (11:54 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Fri, 27 Sep 2019 14:55:12 +0000 (16:55 +0200)
BugLink: https://bugs.launchpad.net/bugs/1834465
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>
Reported-by: kbuild test robot <lkp@intel.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(backported from commit 9b1c1ef13b35fa35051b635ca9fbda39fe6bbc70)
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/vrf.c
include/net/ip6_route.h
net/bluetooth/6lowpan.c
net/ipv6/ip6_output.c

index b84a34218378bb494956718f128f4da5ac9da5cf..8907900fcac88de4111eea3bbe3411fdcf8b0de4 100644 (file)
@@ -363,8 +363,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);
index 5c9732fdbecf8884d02c35c5de07f06a6c7796bc..ba85be3f4f71b50a8a45867d4c563817be40fd8c 100644 (file)
@@ -242,8 +242,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;
index 357475cceec61ba264fd49621e75de624f4afff4..1af9613291d954f4d56a9df316e7dd2b149d0096 100644 (file)
@@ -167,10 +167,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;
 
        BT_DBG("peers %d addr %pI6c rt %p", count, daddr, rt);
 
index dabf9f124870f34533d882945e98382c0e9b1d75..5fceb667843a146255fe7beaa4100fc41fc3faab 100644 (file)
@@ -63,8 +63,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)) {