tree 1b6d1a29f39ce0541e1248639adc496986261a13
parent cbcd2a4cca1a6223e4f98661ef524919d322675e
author Kyle Moffett <[EMAIL PROTECTED]> Thu, 28 Jul 2005 04:22:30 -0700
committer David S. Miller <[EMAIL PROTECTED]> Thu, 28 Jul 2005 04:22:30 -0700

[NET]: Fix setsockopt locking bug

On Sparc, SO_DONTLINGER support resulted in sock_reset_flag being 
called without lock_sock().

Signed-off-by: Kyle Moffett <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

 net/core/sock.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -206,13 +206,14 @@ int sock_setsockopt(struct socket *sock,
         */
 
 #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);
        
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to