Skip to content

Commit

Permalink
ipv6: constify inet6_mc_check()
Browse files Browse the repository at this point in the history
inet6_mc_check() is essentially a read-only function.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Mar 17, 2023
1 parent a0a989d commit 66eb554
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/net/addrconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
const struct in6_addr *addr);
void __ipv6_sock_mc_close(struct sock *sk);
void ipv6_sock_mc_close(struct sock *sk);
bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
bool inet6_mc_check(const struct sock *sk, const struct in6_addr *mc_addr,
const struct in6_addr *src_addr);

int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr);
Expand Down
8 changes: 4 additions & 4 deletions net/ipv6/mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,12 +627,12 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
return 0;
}

bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
bool inet6_mc_check(const struct sock *sk, const struct in6_addr *mc_addr,
const struct in6_addr *src_addr)
{
struct ipv6_pinfo *np = inet6_sk(sk);
struct ipv6_mc_socklist *mc;
struct ip6_sf_socklist *psl;
const struct ipv6_pinfo *np = inet6_sk(sk);
const struct ipv6_mc_socklist *mc;
const struct ip6_sf_socklist *psl;
bool rv = true;

rcu_read_lock();
Expand Down

0 comments on commit 66eb554

Please sign in to comment.