--- src/sys/netinet/ip_encap.c 2005/02/01 05:34:33 1.11 +++ src/sys/netinet/ip_encap.c 2005/06/02 23:52:42 1.12 @@ -91,6 +91,7 @@ #include #include +#include MALLOC_DEFINE(M_NETADDR, "Export Host", "Export host address structure"); static void encap_add (struct encaptab *); @@ -314,9 +315,8 @@ encap_attach(af, proto, sp, sm, dp, dm, { struct encaptab *ep; int error; - int s; - s = splnet(); + crit_enter(); /* sanity check on args */ if (sp->sa_len > sizeof ep->src || dp->sa_len > sizeof ep->dst) { error = EINVAL; @@ -368,11 +368,11 @@ encap_attach(af, proto, sp, sm, dp, dm, encap_add(ep); error = 0; - splx(s); + crit_exit(); return ep; fail: - splx(s); + crit_exit(); return NULL; } @@ -386,9 +386,8 @@ encap_attach_func(af, proto, func, psw, { struct encaptab *ep; int error; - int s; - s = splnet(); + crit_enter(); /* sanity check on args */ if (!func) { error = EINVAL; @@ -410,11 +409,11 @@ encap_attach_func(af, proto, func, psw, encap_add(ep); error = 0; - splx(s); + crit_exit(); return ep; fail: - splx(s); + crit_exit(); return NULL; }