All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: David Ahern <dsahern@kernel.org>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	Eric Dumazet <edumazet@google.com>
Subject: [PATCH net-next 4/8] ipv6: constify inet6_mc_check()
Date: Wed, 15 Mar 2023 15:42:41 +0000	[thread overview]
Message-ID: <20230315154245.3405750-5-edumazet@google.com> (raw)
In-Reply-To: <20230315154245.3405750-1-edumazet@google.com>

inet6_mc_check() is essentially a read-only function.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/addrconf.h | 2 +-
 net/ipv6/mcast.c       | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index c04f359655b86feed2b4b42cc69b90c63088238a..82da55101b5a30b2a5512d964429d2c5f73d03fd 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -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);
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 1c02160cf7a4c54f0d8687b8368e5f6151ab0bce..714cdc9e2b8edfb925a061a722c38b37b1c6088e 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -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();
-- 
2.40.0.rc1.284.g88254d51c5-goog


  parent reply	other threads:[~2023-03-15 15:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 15:42 [PATCH net-next 0/8] inet: better const qualifier awareness Eric Dumazet
2023-03-15 15:42 ` [PATCH net-next 1/8] inet: preserve const qualifier in inet_sk() Eric Dumazet
2023-03-15 18:52   ` Simon Horman
2023-03-15 21:28   ` Jakub Kicinski
2023-03-15 22:37     ` Eric Dumazet
2023-03-15 23:08       ` Jakub Kicinski
2023-03-15 23:16         ` Eric Dumazet
2023-03-15 23:21       ` Linus Torvalds
2023-03-15 23:37         ` Eric Dumazet
2023-03-15 23:47           ` Linus Torvalds
2023-03-15 23:39         ` Linus Torvalds
2023-03-15 23:45           ` Eric Dumazet
2023-03-15 23:54             ` Linus Torvalds
2023-03-15 23:56               ` Eric Dumazet
2023-03-16  0:02                 ` Linus Torvalds
2023-03-16  0:11                   ` Eric Dumazet
2023-03-16  0:23                     ` Eric Dumazet
2023-03-16  0:34                       ` Linus Torvalds
2023-03-15 15:42 ` [PATCH net-next 2/8] ipv4: constify ip_mc_sf_allow() socket argument Eric Dumazet
2023-03-15 18:52   ` Simon Horman
2023-03-15 15:42 ` [PATCH net-next 3/8] udp: constify __udp_is_mcast_sock() " Eric Dumazet
2023-03-15 18:53   ` Simon Horman
2023-03-15 15:42 ` Eric Dumazet [this message]
2023-03-15 18:53   ` [PATCH net-next 4/8] ipv6: constify inet6_mc_check() Simon Horman
2023-03-15 15:42 ` [PATCH net-next 5/8] udp6: constify __udp_v6_is_mcast_sock() socket argument Eric Dumazet
2023-03-15 18:53   ` Simon Horman
2023-03-15 15:42 ` [PATCH net-next 6/8] ipv6: raw: constify raw_v6_match() " Eric Dumazet
2023-03-15 18:54   ` Simon Horman
2023-03-15 15:42 ` [PATCH net-next 7/8] ipv4: raw: constify raw_v4_match() " Eric Dumazet
2023-03-15 18:54   ` Simon Horman
2023-03-15 15:42 ` [PATCH net-next 8/8] inet_diag: constify raw_lookup() " Eric Dumazet
2023-03-15 18:54   ` Simon Horman

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=20230315154245.3405750-5-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.