Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/ldpd use SLIST_FOREACH_SAFE when deleting a peer in...
details: https://anonhg.NetBSD.org/src/rev/e9126ee8c597
branches: trunk
changeset: 761282:e9126ee8c597
user: kefren <kefren%NetBSD.org@localhost>
date: Sat Jan 22 19:35:00 2011 +0000
description:
use SLIST_FOREACH_SAFE when deleting a peer in loop
diffstat:
usr.sbin/ldpd/socketops.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diffs (36 lines):
diff -r 5a748d114dca -r e9126ee8c597 usr.sbin/ldpd/socketops.c
--- a/usr.sbin/ldpd/socketops.c Sat Jan 22 19:27:43 2011 +0000
+++ b/usr.sbin/ldpd/socketops.c Sat Jan 22 19:35:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: socketops.c,v 1.3 2010/12/30 11:29:21 kefren Exp $ */
+/* $NetBSD: socketops.c,v 1.4 2011/01/22 19:35:00 kefren Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -457,7 +457,7 @@
void
send_hello_alarm(int unused)
{
- struct ldp_peer *p;
+ struct ldp_peer *p, *ptmp;
struct hello_info *hi, *hinext;
time_t t = time(NULL);
int olderrno = errno;
@@ -471,15 +471,14 @@
p->timeout--;
/* Check for timeout */
-check_peer:
- SLIST_FOREACH(p, &ldp_peer_head, peers)
+ SLIST_FOREACH_SAFE(p, &ldp_peer_head, peers, ptmp)
if (p->timeout < 1)
switch (p->state) {
case LDP_PEER_HOLDDOWN:
debugp("LDP holddown expired for peer %s\n",
inet_ntoa(p->ldp_id));
ldp_peer_delete(p);
- goto check_peer;
+ break;
case LDP_PEER_ESTABLISHED:
case LDP_PEER_CONNECTED:
send_notification(p, 0,
Home |
Main Index |
Thread Index |
Old Index