未验证 提交 e897e3ca 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!961 [sync] PR-925: tcp: prohibit TCP_REPAIR_OPTIONS if data was already sent

Merge Pull Request from: @openeuler-sync-bot 
 

Origin pull request: 
https://gitee.com/openeuler/kernel/pulls/925 
 
PR sync from: Lu Wei luwei32@huawei.com https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/thread/I2EQIIQZEV4HWCI4CUWWZFLX2LZQGUDT/ 
 
Link:https://gitee.com/openeuler/kernel/pulls/961 

Reviewed-by: Yue Haibing <yuehaibing@huawei.com> 
Reviewed-by: Jialin Zhang <zhangjialin11@huawei.com> 
Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> 
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册