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>
This commit is contained in:
Eric Dumazet 2024-08-02 13:40:25 +00:00 committed by Jakub Kicinski
parent 10a6545f0b
commit a2dc7bee4f
5 changed files with 6 additions and 5 deletions

View File

@ -175,7 +175,7 @@ struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo,
int inet6_hash(struct sock *sk); 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 *saddr,
const struct in6_addr *daddr, const struct in6_addr *daddr,
const __portpair ports, const __portpair ports,

View File

@ -351,7 +351,7 @@ static inline struct sock *inet_lookup_listener(struct net *net,
((__force __u64)(__be32)(__saddr))) ((__force __u64)(__be32)(__saddr)))
#endif /* __BIG_ENDIAN */ #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, const __addrpair cookie, const __portpair ports,
int dif, int sdif) int dif, int sdif)
{ {

View File

@ -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; 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) int dif, int sdif)
{ {
#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV) #if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV)

View File

@ -310,7 +310,7 @@ inet_lhash2_bucket_sk(struct inet_hashinfo *h, struct sock *sk)
return inet_lhash2_bucket(h, hash); return inet_lhash2_bucket(h, hash);
} }
static inline int compute_score(struct sock *sk, struct net *net, static inline int compute_score(struct sock *sk, const struct net *net,
const unsigned short hnum, const __be32 daddr, const unsigned short hnum, const __be32 daddr,
const int dif, const int sdif) const int dif, const int sdif)
{ {

View File

@ -89,7 +89,7 @@ found:
} }
EXPORT_SYMBOL(__inet6_lookup_established); EXPORT_SYMBOL(__inet6_lookup_established);
static inline int compute_score(struct sock *sk, struct net *net, static inline int compute_score(struct sock *sk, const struct net *net,
const unsigned short hnum, const unsigned short hnum,
const struct in6_addr *daddr, const struct in6_addr *daddr,
const int dif, const int sdif) const int dif, const int sdif)