diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-01-10 17:17:53 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-01-10 17:17:53 +0000 |
commit | b2ad5f821b1381492d792ca10b1eb7a107b48f14 (patch) | |
tree | 954a648692e7da983db1d2470953705f6a729264 /net/core/sock.c | |
parent | c9c06167e7933d93a6e396174c68abf242294abb (diff) |
Merge with Linux 2.4.0-prerelease. Big Makefile rewrite, test your
Makefiles.
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 7b9484437..d15bd82f4 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -7,7 +7,7 @@ * handler for protocols to use and generic option handler. * * - * Version: $Id: sock.c,v 1.101 2000/11/10 04:02:04 davem Exp $ + * Version: $Id: sock.c,v 1.102 2000/12/11 23:00:24 davem Exp $ * * Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> @@ -866,24 +866,17 @@ void sklist_remove_socket(struct sock **list, struct sock *sk) write_lock_bh(&net_big_sklist_lock); - s= *list; - if(s==sk) - { - *list = s->next; - write_unlock_bh(&net_big_sklist_lock); - sock_put(sk); - return; - } - while(s && s->next) - { - if(s->next==sk) - { - s->next=sk->next; + while ((s = *list) != NULL) { + if (s == sk) { + *list = s->next; break; } - s=s->next; + list = &s->next; } + write_unlock_bh(&net_big_sklist_lock); + if (s) + sock_put(s); } void sklist_insert_socket(struct sock **list, struct sock *sk) |