diff options
author | mav <mav@FreeBSD.org> | 2008-06-22 11:39:42 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2008-06-22 11:39:42 +0000 |
commit | 4537f7afad1a891b42bbc3836757d1dcf8ee7934 (patch) | |
tree | ae8a4acc643f2a4b438f5b8d076a54339aa525bc /sys/netinet/libalias/alias_db.c | |
parent | 9fe1756df85e1b11c091f8ab0cdcf473bd93553a (diff) | |
download | FreeBSD-src-4537f7afad1a891b42bbc3836757d1dcf8ee7934.zip FreeBSD-src-4537f7afad1a891b42bbc3836757d1dcf8ee7934.tar.gz |
Partially revert previous commit. DeleteLink() does not deletes permanent
links so we should be aware of it and try to delete every link only once
or we will loop forever.
Diffstat (limited to 'sys/netinet/libalias/alias_db.c')
-rw-r--r-- | sys/netinet/libalias/alias_db.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index a9e96d1..c9942b8 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -819,8 +819,12 @@ CleanupAliasData(struct libalias *la) LIBALIAS_LOCK_ASSERT(la); for (i = 0; i < LINK_TABLE_OUT_SIZE; i++) { - while ((lnk = LIST_FIRST(&la->linkTableOut[i])) != NULL) + lnk = LIST_FIRST(&la->linkTableOut[i]); + while (lnk != NULL) { + struct alias_link *link_next = LIST_NEXT(lnk, list_out); DeleteLink(lnk); + lnk = link_next; + } } la->cleanupIndex = 0; |