提交 a77be819 编写于 作者: K Kyle Moffett 提交者: David S. Miller

[NET]: Fix setsockopt locking bug

On Sparc, SO_DONTLINGER support resulted in sock_reset_flag being 
called without lock_sock().
Signed-off-by: NKyle Moffett <mrmacman_g4@mac.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 cbcd2a4c
......@@ -206,13 +206,14 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
*/
#ifdef SO_DONTLINGER /* Compatibility item... */
switch (optname) {
case SO_DONTLINGER:
sock_reset_flag(sk, SOCK_LINGER);
return 0;
if (optname == SO_DONTLINGER) {
lock_sock(sk);
sock_reset_flag(sk, SOCK_LINGER);
release_sock(sk);
return 0;
}
#endif
#endif
if(optlen<sizeof(int))
return(-EINVAL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册