Commit 5bc67a85 authored by Guillaume Nault's avatar Guillaume Nault Committed by David S. Miller

ipv6: Constify the sk parameter of several helper functions.

icmpv6_flow_init(), ip6_datagram_flow_key_init() and ip6_mc_hdr() don't
need to modify their sk argument. Make that explicit using const.
Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8d6eba33
...@@ -85,12 +85,10 @@ extern void icmpv6_param_prob_reason(struct sk_buff *skb, ...@@ -85,12 +85,10 @@ extern void icmpv6_param_prob_reason(struct sk_buff *skb,
struct flowi6; struct flowi6;
struct in6_addr; struct in6_addr;
extern void icmpv6_flow_init(struct sock *sk,
struct flowi6 *fl6, void icmpv6_flow_init(const struct sock *sk, struct flowi6 *fl6, u8 type,
u8 type,
const struct in6_addr *saddr, const struct in6_addr *saddr,
const struct in6_addr *daddr, const struct in6_addr *daddr, int oif);
int oif);
static inline void icmpv6_param_prob(struct sk_buff *skb, u8 code, int pos) static inline void icmpv6_param_prob(struct sk_buff *skb, u8 code, int pos)
{ {
......
...@@ -38,10 +38,11 @@ static bool ipv6_mapped_addr_any(const struct in6_addr *a) ...@@ -38,10 +38,11 @@ static bool ipv6_mapped_addr_any(const struct in6_addr *a)
return ipv6_addr_v4mapped(a) && (a->s6_addr32[3] == 0); return ipv6_addr_v4mapped(a) && (a->s6_addr32[3] == 0);
} }
static void ip6_datagram_flow_key_init(struct flowi6 *fl6, struct sock *sk) static void ip6_datagram_flow_key_init(struct flowi6 *fl6,
const struct sock *sk)
{ {
struct inet_sock *inet = inet_sk(sk); const struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); const struct ipv6_pinfo *np = inet6_sk(sk);
int oif = sk->sk_bound_dev_if; int oif = sk->sk_bound_dev_if;
memset(fl6, 0, sizeof(*fl6)); memset(fl6, 0, sizeof(*fl6));
......
...@@ -1034,11 +1034,9 @@ static int icmpv6_rcv(struct sk_buff *skb) ...@@ -1034,11 +1034,9 @@ static int icmpv6_rcv(struct sk_buff *skb)
return 0; return 0;
} }
void icmpv6_flow_init(struct sock *sk, struct flowi6 *fl6, void icmpv6_flow_init(const struct sock *sk, struct flowi6 *fl6, u8 type,
u8 type,
const struct in6_addr *saddr, const struct in6_addr *saddr,
const struct in6_addr *daddr, const struct in6_addr *daddr, int oif)
int oif)
{ {
memset(fl6, 0, sizeof(*fl6)); memset(fl6, 0, sizeof(*fl6));
fl6->saddr = *saddr; fl6->saddr = *saddr;
......
...@@ -1699,11 +1699,9 @@ mld_scount(struct ifmcaddr6 *pmc, int type, int gdeleted, int sdeleted) ...@@ -1699,11 +1699,9 @@ mld_scount(struct ifmcaddr6 *pmc, int type, int gdeleted, int sdeleted)
return scount; return scount;
} }
static void ip6_mc_hdr(struct sock *sk, struct sk_buff *skb, static void ip6_mc_hdr(const struct sock *sk, struct sk_buff *skb,
struct net_device *dev, struct net_device *dev, const struct in6_addr *saddr,
const struct in6_addr *saddr, const struct in6_addr *daddr, int proto, int len)
const struct in6_addr *daddr,
int proto, int len)
{ {
struct ipv6hdr *hdr; struct ipv6hdr *hdr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment