summaryrefslogtreecommitdiffstats
path: root/sys/net/if_gif.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-10-16 13:37:54 +0000
committerglebius <glebius@FreeBSD.org>2012-10-16 13:37:54 +0000
commit05f24a6b77a43334f14f31cd33a4f3e34a418ea2 (patch)
tree0f54a9446bfe2083d3c0a3f744318b2be8a0db05 /sys/net/if_gif.c
parent745884b065065ffc8847d3ea463bf751ffcaf863 (diff)
downloadFreeBSD-src-05f24a6b77a43334f14f31cd33a4f3e34a418ea2.zip
FreeBSD-src-05f24a6b77a43334f14f31cd33a4f3e34a418ea2.tar.gz
Make the "struct if_clone" opaque to users of the cloning API. Users
now use function calls: if_clone_simple() if_clone_advanced() to initialize a cloner, instead of macros that initialize if_clone structure. Discussed with: brooks, bz, 1 year ago
Diffstat (limited to 'sys/net/if_gif.c')
-rw-r--r--sys/net/if_gif.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 783607b..9fef6c7 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -88,7 +88,7 @@
#include <security/mac/mac_framework.h>
-#define GIFNAME "gif"
+static const char gifname[] = "gif";
/*
* gif_mtx protects the global gif_softc_list.
@@ -106,8 +106,7 @@ void (*ng_gif_detach_p)(struct ifnet *ifp);
static void gif_start(struct ifnet *);
static int gif_clone_create(struct if_clone *, int, caddr_t);
static void gif_clone_destroy(struct ifnet *);
-
-IFC_SIMPLE_DECLARE(gif, 0);
+static struct if_clone *gif_cloner;
static int gifmodevent(module_t, int, void *);
@@ -171,7 +170,7 @@ gif_clone_create(ifc, unit, params)
GIF_LOCK_INIT(sc);
GIF2IFP(sc)->if_softc = sc;
- if_initname(GIF2IFP(sc), ifc->ifc_name, unit);
+ if_initname(GIF2IFP(sc), gifname, unit);
sc->encap_cookie4 = sc->encap_cookie6 = NULL;
sc->gif_options = GIF_ACCEPT_REVETHIP;
@@ -256,11 +255,12 @@ gifmodevent(mod, type, data)
switch (type) {
case MOD_LOAD:
mtx_init(&gif_mtx, "gif_mtx", NULL, MTX_DEF);
- if_clone_attach(&gif_cloner);
+ gif_cloner = if_clone_simple(gifname, gif_clone_create,
+ gif_clone_destroy, 0);
break;
case MOD_UNLOAD:
- if_clone_detach(&gif_cloner);
+ if_clone_detach(gif_cloner);
mtx_destroy(&gif_mtx);
break;
default:
OpenPOWER on IntegriCloud