tcp: md5: constify tcp_md5_do_lookup() socket argument
When TCP new listener is done, these functions will be called without socket lock being held. Make sure they don't change anything. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
4e3f5d727d
commit
b83e3deb97
@@ -1372,16 +1372,16 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr,
|
||||
int family, const u8 *newkey, u8 newkeylen, gfp_t gfp);
|
||||
int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr,
|
||||
int family);
|
||||
struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
|
||||
struct tcp_md5sig_key *tcp_v4_md5_lookup(const struct sock *sk,
|
||||
const struct sock *addr_sk);
|
||||
|
||||
#ifdef CONFIG_TCP_MD5SIG
|
||||
struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk,
|
||||
struct tcp_md5sig_key *tcp_md5_do_lookup(const struct sock *sk,
|
||||
const union tcp_md5_addr *addr,
|
||||
int family);
|
||||
#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key)
|
||||
#else
|
||||
static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk,
|
||||
static inline struct tcp_md5sig_key *tcp_md5_do_lookup(const struct sock *sk,
|
||||
const union tcp_md5_addr *addr,
|
||||
int family)
|
||||
{
|
||||
@@ -1684,7 +1684,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
|
||||
/* TCP af-specific functions */
|
||||
struct tcp_sock_af_ops {
|
||||
#ifdef CONFIG_TCP_MD5SIG
|
||||
struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk,
|
||||
struct tcp_md5sig_key *(*md5_lookup) (const struct sock *sk,
|
||||
const struct sock *addr_sk);
|
||||
int (*calc_md5_hash)(char *location,
|
||||
const struct tcp_md5sig_key *md5,
|
||||
@@ -1699,7 +1699,7 @@ struct tcp_sock_af_ops {
|
||||
struct tcp_request_sock_ops {
|
||||
u16 mss_clamp;
|
||||
#ifdef CONFIG_TCP_MD5SIG
|
||||
struct tcp_md5sig_key *(*req_md5_lookup)(struct sock *sk,
|
||||
struct tcp_md5sig_key *(*req_md5_lookup)(const struct sock *sk,
|
||||
const struct sock *addr_sk);
|
||||
int (*calc_md5_hash) (char *location,
|
||||
const struct tcp_md5sig_key *md5,
|
||||
|
||||
Reference in New Issue
Block a user