Unverified Commit 76de4d65 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!925 tcp: prohibit TCP_REPAIR_OPTIONS if data was already sent

parents 2c2b88e1 cd2fedb1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3295,7 +3295,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, int optname,
	case TCP_REPAIR_OPTIONS:
		if (!tp->repair)
			err = -EINVAL;
		else if (sk->sk_state == TCP_ESTABLISHED)
		else if (sk->sk_state == TCP_ESTABLISHED && !tp->bytes_sent)
			err = tcp_repair_options_est(sk, optval, optlen);
		else
			err = -EPERM;