mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 14:24:11 +08:00
sock: expose so_timestamp options for mptcp
This exports SO_TIMESTAMP_* function for re-use by MPTCP. Without this there is too much copy & paste needed to support this from mptcp setsockopt path. Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ebbf5fcb94
commit
371087aa47
@ -2743,6 +2743,7 @@ static inline bool sk_dev_equal_l3scope(struct sock *sk, int dif)
|
||||
void sock_def_readable(struct sock *sk);
|
||||
|
||||
int sock_bindtoindex(struct sock *sk, int ifindex, bool lock_sk);
|
||||
void sock_set_timestamp(struct sock *sk, int optname, bool valbool);
|
||||
void sock_enable_timestamps(struct sock *sk);
|
||||
void sock_no_linger(struct sock *sk);
|
||||
void sock_set_keepalive(struct sock *sk);
|
||||
|
@ -776,6 +776,24 @@ void sock_enable_timestamps(struct sock *sk)
|
||||
}
|
||||
EXPORT_SYMBOL(sock_enable_timestamps);
|
||||
|
||||
void sock_set_timestamp(struct sock *sk, int optname, bool valbool)
|
||||
{
|
||||
switch (optname) {
|
||||
case SO_TIMESTAMP_OLD:
|
||||
__sock_set_timestamps(sk, valbool, false, false);
|
||||
break;
|
||||
case SO_TIMESTAMP_NEW:
|
||||
__sock_set_timestamps(sk, valbool, true, false);
|
||||
break;
|
||||
case SO_TIMESTAMPNS_OLD:
|
||||
__sock_set_timestamps(sk, valbool, false, true);
|
||||
break;
|
||||
case SO_TIMESTAMPNS_NEW:
|
||||
__sock_set_timestamps(sk, valbool, true, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sock_set_keepalive(struct sock *sk)
|
||||
{
|
||||
lock_sock(sk);
|
||||
@ -989,16 +1007,10 @@ set_sndbuf:
|
||||
break;
|
||||
|
||||
case SO_TIMESTAMP_OLD:
|
||||
__sock_set_timestamps(sk, valbool, false, false);
|
||||
break;
|
||||
case SO_TIMESTAMP_NEW:
|
||||
__sock_set_timestamps(sk, valbool, true, false);
|
||||
break;
|
||||
case SO_TIMESTAMPNS_OLD:
|
||||
__sock_set_timestamps(sk, valbool, false, true);
|
||||
break;
|
||||
case SO_TIMESTAMPNS_NEW:
|
||||
__sock_set_timestamps(sk, valbool, true, true);
|
||||
sock_set_timestamp(sk, valbool, optname);
|
||||
break;
|
||||
case SO_TIMESTAMPING_NEW:
|
||||
case SO_TIMESTAMPING_OLD:
|
||||
|
Loading…
Reference in New Issue
Block a user