diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2016-07-01 23:29:56 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2016-07-01 23:29:56 +0000 |
commit | 2d65c4f7cd8db7125bb35dfe33fffd414d78888d (patch) | |
tree | b5b0b30b53123c4f47b94ac584b9dd4083e71c4a /usr.sbin/ldpd/interface.c | |
parent | 78bebcb80236c6dddb7e534dd064346d688f08e6 (diff) |
Several minor tweaks.
Diffstat (limited to 'usr.sbin/ldpd/interface.c')
-rw-r--r-- | usr.sbin/ldpd/interface.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/usr.sbin/ldpd/interface.c b/usr.sbin/ldpd/interface.c index 98c846bb31d..8ce9598b4cc 100644 --- a/usr.sbin/ldpd/interface.c +++ b/usr.sbin/ldpd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.46 2016/06/18 17:31:32 renato Exp $ */ +/* $OpenBSD: interface.c,v 1.47 2016/07/01 23:29:55 renato Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org> @@ -82,8 +82,20 @@ if_new(struct kif *kif) return (iface); } +struct iface * +if_lookup(struct ldpd_conf *xconf, unsigned short ifindex) +{ + struct iface *iface; + + LIST_FOREACH(iface, &xconf->iface_list, entry) + if (iface->ifindex == ifindex) + return (iface); + + return (NULL); +} + void -if_del(struct iface *iface) +if_exit(struct iface *iface) { struct if_addr *if_addr; @@ -98,20 +110,6 @@ if_del(struct iface *iface) LIST_REMOVE(if_addr, entry); free(if_addr); } - - free(iface); -} - -struct iface * -if_lookup(struct ldpd_conf *xconf, unsigned short ifindex) -{ - struct iface *iface; - - LIST_FOREACH(iface, &xconf->iface_list, entry) - if (iface->ifindex == ifindex) - return (iface); - - return (NULL); } struct iface_af * |