Changeset View
Changeset View
Standalone View
Standalone View
sys/security/mac_ifoff/mac_ifoff.c
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
ifnet_check_outgoing(struct ifnet *ifp) | ifnet_check_outgoing(struct ifnet *ifp) | ||||
{ | { | ||||
if (!ifoff_enabled) | if (!ifoff_enabled) | ||||
return (0); | return (0); | ||||
if (ifoff_lo_enabled && ifp->if_type == IFT_LOOP) | if (ifoff_lo_enabled && if_gettype(ifp) == IFT_LOOP) | ||||
return (0); | return (0); | ||||
if (ifoff_other_enabled && ifp->if_type != IFT_LOOP) | if (ifoff_other_enabled && if_gettype(ifp) != IFT_LOOP) | ||||
return (0); | return (0); | ||||
return (EPERM); | return (EPERM); | ||||
} | } | ||||
static int | static int | ||||
ifnet_check_incoming(struct ifnet *ifp, int viabpf) | ifnet_check_incoming(struct ifnet *ifp, int viabpf) | ||||
{ | { | ||||
if (!ifoff_enabled) | if (!ifoff_enabled) | ||||
return (0); | return (0); | ||||
if (ifoff_lo_enabled && ifp->if_type == IFT_LOOP) | if (ifoff_lo_enabled && if_gettype(ifp) == IFT_LOOP) | ||||
return (0); | return (0); | ||||
if (ifoff_other_enabled && ifp->if_type != IFT_LOOP) | if (ifoff_other_enabled && if_gettype(ifp) != IFT_LOOP) | ||||
return (0); | return (0); | ||||
if (viabpf && ifoff_bpfrecv_enabled) | if (viabpf && ifoff_bpfrecv_enabled) | ||||
return (0); | return (0); | ||||
return (EPERM); | return (EPERM); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |