Two problems here:
1. Dependency on netgraph module was broken (wrong version). 2. Netgraph node type was never destroyed on unload. This was masked by problem #1. Fixed both by using NETGRAPH_INIT(). Now netgraph node type is created on module load, as in the rest of netgraph modules.
This commit is contained in:
parent
ec63861d6b
commit
7becf838ce
@ -182,8 +182,6 @@ static int irqtable[16] = {
|
||||
|
||||
#ifndef NETGRAPH
|
||||
MODULE_DEPEND(if_ar, sppp, 1, 1, 1);
|
||||
#else
|
||||
MODULE_DEPEND(ng_sync_ar, netgraph, 1, 1, 1);
|
||||
#endif
|
||||
|
||||
static void arintr(void *arg);
|
||||
@ -215,7 +213,6 @@ static void ar_timer_intr(struct ar_hardc *hc, int scano, u_char isr);
|
||||
|
||||
#ifdef NETGRAPH
|
||||
static void ngar_watchdog_frame(void * arg);
|
||||
static void ngar_init(void* ignored);
|
||||
|
||||
static ng_constructor_t ngar_constructor;
|
||||
static ng_rcvmsg_t ngar_rcvmsg;
|
||||
@ -237,8 +234,7 @@ static struct ng_type typestruct = {
|
||||
.rcvdata = ngar_rcvdata,
|
||||
.disconnect = ngar_disconnect,
|
||||
};
|
||||
|
||||
static int ngar_done_init = 0;
|
||||
NETGRAPH_INIT(sync_ar, &typestruct);
|
||||
#endif /* NETGRAPH */
|
||||
|
||||
int
|
||||
@ -321,10 +317,6 @@ ar_attach(device_t device)
|
||||
|
||||
bpfattach(ifp, DLT_PPP, PPP_HEADER_LEN);
|
||||
#else /* NETGRAPH */
|
||||
/*
|
||||
* we have found a node, make sure our 'type' is availabe.
|
||||
*/
|
||||
if (ngar_done_init == 0) ngar_init(NULL);
|
||||
if (ng_make_node_common(&typestruct, &sc->node) != 0)
|
||||
return (1);
|
||||
sprintf(sc->nodename, "%s%d", NG_AR_NODE_TYPE, sc->unit);
|
||||
@ -2344,18 +2336,6 @@ ngar_disconnect(hook_p hook)
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* called during bootup
|
||||
* or LKM loading to put this type into the list of known modules
|
||||
*/
|
||||
static void
|
||||
ngar_init(void *ignored)
|
||||
{
|
||||
if (ng_newtype(&typestruct))
|
||||
printf("ngar install failed\n");
|
||||
ngar_done_init = 1;
|
||||
}
|
||||
#endif /* NETGRAPH */
|
||||
|
||||
/*
|
||||
|
@ -223,8 +223,6 @@ int etc0vals[] = {
|
||||
devclass_t sr_devclass;
|
||||
#ifndef NETGRAPH
|
||||
MODULE_DEPEND(if_sr, sppp, 1, 1, 1);
|
||||
#else
|
||||
MODULE_DEPEND(ng_sync_sr, netgraph, 1, 1, 1);
|
||||
#endif
|
||||
|
||||
static void srintr(void *arg);
|
||||
@ -262,7 +260,6 @@ static void sr_modemck(struct sr_softc *x);
|
||||
|
||||
#ifdef NETGRAPH
|
||||
static void ngsr_watchdog_frame(void * arg);
|
||||
static void ngsr_init(void* ignored);
|
||||
|
||||
static ng_constructor_t ngsr_constructor;
|
||||
static ng_rcvmsg_t ngsr_rcvmsg;
|
||||
@ -284,8 +281,7 @@ static struct ng_type typestruct = {
|
||||
.rcvdata = ngsr_rcvdata,
|
||||
.disconnect = ngsr_disconnect,
|
||||
};
|
||||
|
||||
static int ngsr_done_init = 0;
|
||||
NETGRAPH_INIT(sync_sr, &typestruct);
|
||||
#endif /* NETGRAPH */
|
||||
|
||||
/*
|
||||
@ -432,10 +428,6 @@ sr_attach(device_t device)
|
||||
|
||||
bpfattach(ifp, DLT_PPP, PPP_HEADER_LEN);
|
||||
#else /* NETGRAPH */
|
||||
/*
|
||||
* we have found a node, make sure our 'type' is availabe.
|
||||
*/
|
||||
if (ngsr_done_init == 0) ngsr_init(NULL);
|
||||
if (ng_make_node_common(&typestruct, &sc->node) != 0)
|
||||
goto errexit;
|
||||
sprintf(sc->nodename, "%s%d", NG_SR_NODE_TYPE, sc->unit);
|
||||
@ -2944,18 +2936,6 @@ ngsr_disconnect(hook_p hook)
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* called during bootup
|
||||
* or LKM loading to put this type into the list of known modules
|
||||
*/
|
||||
static void
|
||||
ngsr_init(void *ignored)
|
||||
{
|
||||
if (ng_newtype(&typestruct))
|
||||
printf("ngsr install failed\n");
|
||||
ngsr_done_init = 1;
|
||||
}
|
||||
#endif /* NETGRAPH */
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user