mptcp: rename addr_signal and the related functions
This patch renamed addr_signal and the related functions with the explicit word "add". Suggested-by: Matthieu Baerts <matthieu.baerts@tessares.net> Suggested-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Geliang Tang <geliangtang@gmail.com> Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
075c156850
commit
f643b8032e
|
@ -571,18 +571,18 @@ static u64 add_addr6_generate_hmac(u64 key1, u64 key2, u8 addr_id,
|
|||
}
|
||||
#endif
|
||||
|
||||
static bool mptcp_established_options_addr(struct sock *sk,
|
||||
unsigned int *size,
|
||||
unsigned int remaining,
|
||||
struct mptcp_out_options *opts)
|
||||
static bool mptcp_established_options_add_addr(struct sock *sk,
|
||||
unsigned int *size,
|
||||
unsigned int remaining,
|
||||
struct mptcp_out_options *opts)
|
||||
{
|
||||
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
|
||||
struct mptcp_sock *msk = mptcp_sk(subflow->conn);
|
||||
struct mptcp_addr_info saddr;
|
||||
int len;
|
||||
|
||||
if (!mptcp_pm_should_signal(msk) ||
|
||||
!(mptcp_pm_addr_signal(msk, remaining, &saddr)))
|
||||
if (!mptcp_pm_should_add_signal(msk) ||
|
||||
!(mptcp_pm_add_addr_signal(msk, remaining, &saddr)))
|
||||
return false;
|
||||
|
||||
len = mptcp_add_addr_len(saddr.family);
|
||||
|
@ -640,7 +640,7 @@ bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
|
|||
|
||||
*size += opt_size;
|
||||
remaining -= opt_size;
|
||||
if (mptcp_established_options_addr(sk, &opt_size, remaining, opts)) {
|
||||
if (mptcp_established_options_add_addr(sk, &opt_size, remaining, opts)) {
|
||||
*size += opt_size;
|
||||
remaining -= opt_size;
|
||||
ret = true;
|
||||
|
|
|
@ -18,7 +18,7 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk,
|
|||
pr_debug("msk=%p, local_id=%d", msk, addr->id);
|
||||
|
||||
msk->pm.local = *addr;
|
||||
WRITE_ONCE(msk->pm.addr_signal, true);
|
||||
WRITE_ONCE(msk->pm.add_addr_signal, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -151,22 +151,22 @@ void mptcp_pm_add_addr_received(struct mptcp_sock *msk,
|
|||
|
||||
/* path manager helpers */
|
||||
|
||||
bool mptcp_pm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
|
||||
struct mptcp_addr_info *saddr)
|
||||
bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
|
||||
struct mptcp_addr_info *saddr)
|
||||
{
|
||||
int ret = false;
|
||||
|
||||
spin_lock_bh(&msk->pm.lock);
|
||||
|
||||
/* double check after the lock is acquired */
|
||||
if (!mptcp_pm_should_signal(msk))
|
||||
if (!mptcp_pm_should_add_signal(msk))
|
||||
goto out_unlock;
|
||||
|
||||
if (remaining < mptcp_add_addr_len(msk->pm.local.family))
|
||||
goto out_unlock;
|
||||
|
||||
*saddr = msk->pm.local;
|
||||
WRITE_ONCE(msk->pm.addr_signal, false);
|
||||
WRITE_ONCE(msk->pm.add_addr_signal, false);
|
||||
ret = true;
|
||||
|
||||
out_unlock:
|
||||
|
@ -186,7 +186,7 @@ void mptcp_pm_data_init(struct mptcp_sock *msk)
|
|||
msk->pm.local_addr_used = 0;
|
||||
msk->pm.subflows = 0;
|
||||
WRITE_ONCE(msk->pm.work_pending, false);
|
||||
WRITE_ONCE(msk->pm.addr_signal, false);
|
||||
WRITE_ONCE(msk->pm.add_addr_signal, false);
|
||||
WRITE_ONCE(msk->pm.accept_addr, false);
|
||||
WRITE_ONCE(msk->pm.accept_subflow, false);
|
||||
msk->pm.status = 0;
|
||||
|
|
|
@ -162,7 +162,7 @@ struct mptcp_pm_data {
|
|||
|
||||
spinlock_t lock; /*protects the whole PM data */
|
||||
|
||||
bool addr_signal;
|
||||
bool add_addr_signal;
|
||||
bool server_side;
|
||||
bool work_pending;
|
||||
bool accept_addr;
|
||||
|
@ -438,9 +438,9 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk,
|
|||
int mptcp_pm_remove_addr(struct mptcp_sock *msk, u8 local_id);
|
||||
int mptcp_pm_remove_subflow(struct mptcp_sock *msk, u8 remote_id);
|
||||
|
||||
static inline bool mptcp_pm_should_signal(struct mptcp_sock *msk)
|
||||
static inline bool mptcp_pm_should_add_signal(struct mptcp_sock *msk)
|
||||
{
|
||||
return READ_ONCE(msk->pm.addr_signal);
|
||||
return READ_ONCE(msk->pm.add_addr_signal);
|
||||
}
|
||||
|
||||
static inline unsigned int mptcp_add_addr_len(int family)
|
||||
|
@ -450,8 +450,8 @@ static inline unsigned int mptcp_add_addr_len(int family)
|
|||
return TCPOLEN_MPTCP_ADD_ADDR6;
|
||||
}
|
||||
|
||||
bool mptcp_pm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
|
||||
struct mptcp_addr_info *saddr);
|
||||
bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
|
||||
struct mptcp_addr_info *saddr);
|
||||
int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc);
|
||||
|
||||
void __init mptcp_pm_nl_init(void);
|
||||
|
|
Loading…
Reference in New Issue