patch-2.2.4 linux/net/ipv6/ipv6_sockglue.c

Next file: linux/net/ipv6/mcast.c
Previous file: linux/net/ipv6/ip6_output.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.3/linux/net/ipv6/ipv6_sockglue.c linux/net/ipv6/ipv6_sockglue.c
@@ -7,7 +7,7 @@
  *
  *	Based on linux/net/ipv4/ip_sockglue.c
  *
- *	$Id: ipv6_sockglue.c,v 1.24 1998/10/03 09:38:37 davem Exp $
+ *	$Id: ipv6_sockglue.c,v 1.25 1999/03/21 05:22:54 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -86,7 +86,9 @@
 					kfree(new_ra);
 				return -EADDRINUSE;
 			}
+			net_serialize_enter();
 			*rap = ra->next;
+			net_serialize_leave();
 			if (ra->destructor)
 				ra->destructor(sk);
 			kfree(ra);
@@ -136,15 +138,16 @@
 			if (sk->protocol != IPPROTO_UDP &&
 			    sk->protocol != IPPROTO_TCP)
 				goto out;
-			
+
+			lock_sock(sk);
 			if (sk->state != TCP_ESTABLISHED) {
 				retv = ENOTCONN;
-				goto out;
+				goto addrform_done;
 			}
 
 			if (!(ipv6_addr_type(&np->daddr) & IPV6_ADDR_MAPPED)) {
 				retv = -EADDRNOTAVAIL;
-				goto out;
+				goto addrform_done;
 			}
 
 			if (sk->protocol == IPPROTO_TCP) {
@@ -166,6 +169,9 @@
 			if (pktopt)
 				kfree_skb(pktopt);
 			retv = 0;
+
+addrform_done:
+			release_sock(sk);
 		} else {
 			retv = -EINVAL;
 		}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)