diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-12-15 20:29:07 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-12-15 20:29:07 +0000 |
commit | d24b45b2a3b07426e88b816f67726f78730c755a (patch) | |
tree | 8e7497a68a0e4b33168644db2823baee7f506309 /usr.sbin/ospfd/interface.c | |
parent | 2c20c42db624528a8761a4f1cf52ee08d7f6f1c7 (diff) |
Simpify iface_del() and nbr_del(). make them void funtions as they can not fail
and do not remove a element twice in iface_del(). OK norby@
Diffstat (limited to 'usr.sbin/ospfd/interface.c')
-rw-r--r-- | usr.sbin/ospfd/interface.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/usr.sbin/ospfd/interface.c b/usr.sbin/ospfd/interface.c index c22420c4779..864f87031e9 100644 --- a/usr.sbin/ospfd/interface.c +++ b/usr.sbin/ospfd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.39 2005/12/04 20:49:47 norby Exp $ */ +/* $OpenBSD: interface.c,v 1.40 2005/12/15 20:29:06 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -231,7 +231,7 @@ if_new(struct kif *kif) return (iface); } -int +void if_del(struct iface *iface) { struct nbr *nbr = NULL; @@ -239,17 +239,13 @@ if_del(struct iface *iface) log_debug("if_del: interface %s", iface->name); /* clear lists etc */ - iface->self = NULL; /* trick neighbor.c code to remove self too */ - while ((nbr = LIST_FIRST(&iface->nbr_list)) != NULL) { - LIST_REMOVE(nbr, entry); + while ((nbr = LIST_FIRST(&iface->nbr_list)) != NULL) nbr_del(nbr); - } ls_ack_list_clr(iface); md_list_clr(iface); free(iface->auth_key); - - return (-1); + free(iface); } void |