summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2002-03-04 21:43:49 +0000
committerbrooks <brooks@FreeBSD.org>2002-03-04 21:43:49 +0000
commit50d3be4c82e6c70eac43734b67628e7a27fa3e24 (patch)
treee05372a98911db8a86433810b97039584862ca8d /sys/net
parenta7336f1ad6c01a609997c0cb2bbebb2d3141cb99 (diff)
downloadFreeBSD-src-50d3be4c82e6c70eac43734b67628e7a27fa3e24.zip
FreeBSD-src-50d3be4c82e6c70eac43734b67628e7a27fa3e24.tar.gz
Change the network interface cloning API so the destroy function returns
an int errorcode instead of void in preperation for merging cloning of the loopback device. Submitted by: mux MFC after: 2 weeks
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c3
-rw-r--r--sys/net/if.h2
-rw-r--r--sys/net/if_faith.c5
-rw-r--r--sys/net/if_gif.c5
-rw-r--r--sys/net/if_stf.c5
-rw-r--r--sys/net/if_vlan.c5
6 files changed, 14 insertions, 11 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 98dd728..3cbf56d 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -636,8 +636,7 @@ if_clone_destroy(name)
if (ifc->ifc_destroy == NULL)
return (EOPNOTSUPP);
- (*ifc->ifc_destroy)(ifp);
- return (0);
+ return ((*ifc->ifc_destroy)(ifp));
}
/*
diff --git a/sys/net/if.h b/sys/net/if.h
index 7370e12..0b6b733 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -65,7 +65,7 @@ struct if_clone {
size_t ifc_namelen; /* length of name */
int (*ifc_create)(struct if_clone *, int *);
- void (*ifc_destroy)(struct ifnet *);
+ int (*ifc_destroy)(struct ifnet *);
};
#define IF_CLONE_INITIALIZER(name, create, destroy) \
diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c
index 4b30ba0..dc071eb 100644
--- a/sys/net/if_faith.c
+++ b/sys/net/if_faith.c
@@ -108,7 +108,7 @@ static struct rman faithunits[1];
static LIST_HEAD(, faith_softc) faith_softc_list;
int faith_clone_create __P((struct if_clone *, int *));
-void faith_clone_destroy __P((struct ifnet *));
+int faith_clone_destroy __P((struct ifnet *));
struct if_clone faith_cloner =
IF_CLONE_INITIALIZER(FAITHNAME, faith_clone_create, faith_clone_destroy);
@@ -221,7 +221,7 @@ faith_clone_create(ifc, unit)
return (0);
}
-void
+int
faith_clone_destroy(ifp)
struct ifnet *ifp;
{
@@ -236,6 +236,7 @@ faith_clone_destroy(ifp)
KASSERT(err == 0, ("Unexpected error freeing resource"));
free(sc, M_FAITH);
+ return (0);
}
int
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index aa1a022..75ac564 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -94,7 +94,7 @@ void (*ng_gif_attach_p)(struct ifnet *ifp);
void (*ng_gif_detach_p)(struct ifnet *ifp);
int gif_clone_create __P((struct if_clone *, int *));
-void gif_clone_destroy __P((struct ifnet *));
+int gif_clone_destroy __P((struct ifnet *));
struct if_clone gif_cloner =
IF_CLONE_INITIALIZER("gif", gif_clone_create, gif_clone_destroy);
@@ -229,7 +229,7 @@ gif_clone_create(ifc, unit)
return (0);
}
-void
+int
gif_clone_destroy(ifp)
struct ifnet *ifp;
{
@@ -256,6 +256,7 @@ gif_clone_destroy(ifp)
KASSERT(err == 0, ("Unexpected error freeing resource"));
free(sc, M_GIF);
+ return (0);
}
static int
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c
index 1b15c9b..ee14ece 100644
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -163,7 +163,7 @@ static void stf_rtrequest __P((int, struct rtentry *, struct rt_addrinfo *));
static int stf_ioctl __P((struct ifnet *, u_long, caddr_t));
int stf_clone_create __P((struct if_clone *, int *));
-void stf_clone_destroy __P((struct ifnet *));
+int stf_clone_destroy __P((struct ifnet *));
struct if_clone stf_cloner =
IF_CLONE_INITIALIZER(STFNAME, stf_clone_create, stf_clone_destroy);
@@ -216,7 +216,7 @@ stf_clone_create(ifc, unit)
return (0);
}
-void
+int
stf_clone_destroy(ifp)
struct ifnet *ifp;
{
@@ -233,6 +233,7 @@ stf_clone_destroy(ifp)
KASSERT(err == 0, ("Unexpected error freeing resource"));
free(sc, M_STF);
+ return (0);
}
static int
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 759ae81..797feac 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -94,7 +94,7 @@ static struct rman vlanunits[1];
static LIST_HEAD(, ifvlan) ifv_list;
static int vlan_clone_create(struct if_clone *, int *);
-static void vlan_clone_destroy(struct ifnet *);
+static int vlan_clone_destroy(struct ifnet *);
static void vlan_start(struct ifnet *ifp);
static void vlan_ifinit(void *foo);
static int vlan_input(struct ether_header *eh, struct mbuf *m);
@@ -274,7 +274,7 @@ vlan_clone_create(struct if_clone *ifc, int *unit)
return (0);
}
-static void
+static int
vlan_clone_destroy(struct ifnet *ifp)
{
struct ifvlan *ifv = ifp->if_softc;
@@ -291,6 +291,7 @@ vlan_clone_destroy(struct ifnet *ifp)
err = rman_release_resource(ifv->r_unit);
KASSERT(err == 0, ("Unexpected error freeing resource"));
free(ifv, M_VLAN);
+ return (0);
}
static void
OpenPOWER on IntegriCloud