mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 10:27:12 +08:00
Update to FreeBSD head 2016-08-23
Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd.
This commit is contained in:
@@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/vnet.h>
|
||||
|
||||
#include <vm/uma.h>
|
||||
|
||||
/*
|
||||
* System initialization
|
||||
*
|
||||
@@ -139,9 +137,12 @@ protosw_init(struct protosw *pr)
|
||||
|
||||
#define DEFAULT(foo, bar) if ((foo) == NULL) (foo) = (bar)
|
||||
DEFAULT(pu->pru_accept, pru_accept_notsupp);
|
||||
DEFAULT(pu->pru_aio_queue, pru_aio_queue_notsupp);
|
||||
DEFAULT(pu->pru_bind, pru_bind_notsupp);
|
||||
DEFAULT(pu->pru_bindat, pru_bindat_notsupp);
|
||||
DEFAULT(pu->pru_connect, pru_connect_notsupp);
|
||||
DEFAULT(pu->pru_connect2, pru_connect2_notsupp);
|
||||
DEFAULT(pu->pru_connectat, pru_connectat_notsupp);
|
||||
DEFAULT(pu->pru_control, pru_control_notsupp);
|
||||
DEFAULT(pu->pru_disconnect, pru_disconnect_notsupp);
|
||||
DEFAULT(pu->pru_listen, pru_listen_notsupp);
|
||||
@@ -154,6 +155,7 @@ protosw_init(struct protosw *pr)
|
||||
DEFAULT(pu->pru_sosend, sosend_generic);
|
||||
DEFAULT(pu->pru_soreceive, soreceive_generic);
|
||||
DEFAULT(pu->pru_sopoll, sopoll_generic);
|
||||
DEFAULT(pu->pru_ready, pru_ready_notsupp);
|
||||
#undef DEFAULT
|
||||
if (pr->pr_init)
|
||||
(*pr->pr_init)();
|
||||
@@ -196,11 +198,7 @@ void
|
||||
vnet_domain_uninit(void *arg)
|
||||
{
|
||||
struct domain *dp = arg;
|
||||
struct protosw *pr;
|
||||
|
||||
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
|
||||
if (pr->pr_destroy)
|
||||
(*pr->pr_destroy)();
|
||||
if (dp->dom_destroy)
|
||||
(*dp->dom_destroy)();
|
||||
}
|
||||
@@ -249,8 +247,8 @@ domaininit(void *dummy)
|
||||
if (max_linkhdr < 16) /* XXX */
|
||||
max_linkhdr = 16;
|
||||
|
||||
callout_init(&pffast_callout, CALLOUT_MPSAFE);
|
||||
callout_init(&pfslow_callout, CALLOUT_MPSAFE);
|
||||
callout_init(&pffast_callout, 1);
|
||||
callout_init(&pfslow_callout, 1);
|
||||
|
||||
mtx_lock(&dom_mtx);
|
||||
KASSERT(domain_init_status == 0, ("domaininit called too late!"));
|
||||
@@ -272,21 +270,31 @@ domainfinalize(void *dummy)
|
||||
callout_reset(&pfslow_callout, 1, pfslowtimo, NULL);
|
||||
}
|
||||
|
||||
struct domain *
|
||||
pffinddomain(int family)
|
||||
{
|
||||
struct domain *dp;
|
||||
|
||||
for (dp = domains; dp != NULL; dp = dp->dom_next)
|
||||
if (dp->dom_family == family)
|
||||
return (dp);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
struct protosw *
|
||||
pffindtype(int family, int type)
|
||||
{
|
||||
struct domain *dp;
|
||||
struct protosw *pr;
|
||||
|
||||
for (dp = domains; dp; dp = dp->dom_next)
|
||||
if (dp->dom_family == family)
|
||||
goto found;
|
||||
return (0);
|
||||
found:
|
||||
dp = pffinddomain(family);
|
||||
if (dp == NULL)
|
||||
return (NULL);
|
||||
|
||||
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
|
||||
if (pr->pr_type && pr->pr_type == type)
|
||||
return (pr);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
struct protosw *
|
||||
@@ -294,21 +302,22 @@ pffindproto(int family, int protocol, int type)
|
||||
{
|
||||
struct domain *dp;
|
||||
struct protosw *pr;
|
||||
struct protosw *maybe = 0;
|
||||
struct protosw *maybe;
|
||||
|
||||
maybe = NULL;
|
||||
if (family == 0)
|
||||
return (0);
|
||||
for (dp = domains; dp; dp = dp->dom_next)
|
||||
if (dp->dom_family == family)
|
||||
goto found;
|
||||
return (0);
|
||||
found:
|
||||
return (NULL);
|
||||
|
||||
dp = pffinddomain(family);
|
||||
if (dp == NULL)
|
||||
return (NULL);
|
||||
|
||||
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) {
|
||||
if ((pr->pr_protocol == protocol) && (pr->pr_type == type))
|
||||
return (pr);
|
||||
|
||||
if (type == SOCK_RAW && pr->pr_type == SOCK_RAW &&
|
||||
pr->pr_protocol == 0 && maybe == (struct protosw *)0)
|
||||
pr->pr_protocol == 0 && maybe == NULL)
|
||||
maybe = pr;
|
||||
}
|
||||
return (maybe);
|
||||
@@ -336,12 +345,10 @@ pf_proto_register(int family, struct protosw *npr)
|
||||
return (ENXIO);
|
||||
|
||||
/* Try to find the specified domain based on the family. */
|
||||
for (dp = domains; dp; dp = dp->dom_next)
|
||||
if (dp->dom_family == family)
|
||||
goto found;
|
||||
return (EPFNOSUPPORT);
|
||||
dp = pffinddomain(family);
|
||||
if (dp == NULL)
|
||||
return (EPFNOSUPPORT);
|
||||
|
||||
found:
|
||||
/* Initialize backpointer to struct domain. */
|
||||
npr->pr_domain = dp;
|
||||
fpr = NULL;
|
||||
@@ -407,12 +414,10 @@ pf_proto_unregister(int family, int protocol, int type)
|
||||
return (EPROTOTYPE);
|
||||
|
||||
/* Try to find the specified domain based on the family type. */
|
||||
for (dp = domains; dp; dp = dp->dom_next)
|
||||
if (dp->dom_family == family)
|
||||
goto found;
|
||||
return (EPFNOSUPPORT);
|
||||
dp = pffinddomain(family);
|
||||
if (dp == NULL)
|
||||
return (EPFNOSUPPORT);
|
||||
|
||||
found:
|
||||
dpr = NULL;
|
||||
|
||||
/* Lock out everyone else while we are manipulating the protosw. */
|
||||
|
Reference in New Issue
Block a user