Fix a braino in the last revision, enc_clone_destroy needs return void instead

of int. The clone system will ensure that our first interface is not destroyed
so we dont need the extra checking anyway.

Tested by:	Scott Ullrich
This commit is contained in:
Andrew Thompson 2006-07-04 23:09:11 +00:00
parent 867e6caf17
commit bac89dcef2

View File

@ -86,27 +86,18 @@ static int enc_ioctl(struct ifnet *, u_long, caddr_t);
static int enc_output(struct ifnet *ifp, struct mbuf *m, static int enc_output(struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, struct rtentry *rt); struct sockaddr *dst, struct rtentry *rt);
static int enc_clone_create(struct if_clone *, int); static int enc_clone_create(struct if_clone *, int);
static int enc_clone_destroy(struct ifnet *); static void enc_clone_destroy(struct ifnet *);
IFC_SIMPLE_DECLARE(enc, 1); IFC_SIMPLE_DECLARE(enc, 1);
static int static void
enc_clone_destroy(struct ifnet *ifp) enc_clone_destroy(struct ifnet *ifp)
{ {
KASSERT(ifp != encif, ("%s: destroying encif", __func__));
mtx_lock(&enc_mtx);
/* do not allow enc0 to be destroyed */
if (encif == ifp) {
mtx_unlock(&enc_mtx);
return (EBUSY);
}
mtx_unlock(&enc_mtx);
bpfdetach(ifp); bpfdetach(ifp);
if_detach(ifp); if_detach(ifp);
if_free(ifp); if_free(ifp);
return (0);
} }
static int static int