diff options
author | Eric Dumazet <edumazet@google.com> | 2024-08-02 13:40:25 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-08-05 16:22:45 -0700 |
commit | a2dc7bee4f77266ebb8e3a8544fc5f7812835f8c (patch) | |
tree | 1620e27d95b2fef7450e3e150c0c29d31506dc8d /include | |
parent | 10a6545f0bdcbb920c6a8a033fe342111d204915 (diff) | |
download | lwn-a2dc7bee4f77266ebb8e3a8544fc5f7812835f8c.tar.gz lwn-a2dc7bee4f77266ebb8e3a8544fc5f7812835f8c.zip |
inet: constify inet_sk_bound_dev_eq() net parameter
inet_sk_bound_dev_eq() and its callers do not modify the net structure.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240802134029.3748005-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/inet6_hashtables.h | 2 | ||||
-rw-r--r-- | include/net/inet_hashtables.h | 2 | ||||
-rw-r--r-- | include/net/inet_sock.h | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 533a7337865a..591cbf5e4d5f 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h @@ -175,7 +175,7 @@ struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, int inet6_hash(struct sock *sk); -static inline bool inet6_match(struct net *net, const struct sock *sk, +static inline bool inet6_match(const struct net *net, const struct sock *sk, const struct in6_addr *saddr, const struct in6_addr *daddr, const __portpair ports, diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 7f1b38458743..1cc8b7ca20a1 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h @@ -351,7 +351,7 @@ static inline struct sock *inet_lookup_listener(struct net *net, ((__force __u64)(__be32)(__saddr))) #endif /* __BIG_ENDIAN */ -static inline bool inet_match(struct net *net, const struct sock *sk, +static inline bool inet_match(const struct net *net, const struct sock *sk, const __addrpair cookie, const __portpair ports, int dif, int sdif) { diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index f9ddd47dc4f8..394c3b66065e 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h @@ -150,7 +150,8 @@ static inline bool inet_bound_dev_eq(bool l3mdev_accept, int bound_dev_if, return bound_dev_if == dif || bound_dev_if == sdif; } -static inline bool inet_sk_bound_dev_eq(struct net *net, int bound_dev_if, +static inline bool inet_sk_bound_dev_eq(const struct net *net, + int bound_dev_if, int dif, int sdif) { #if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV) |