Changeset View
Changeset View
Standalone View
Standalone View
sys/security/mac_lomac/mac_lomac.c
Show First 20 Lines • Show All 1,182 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
char tifname[IFNAMSIZ], *p, *q; | char tifname[IFNAMSIZ], *p, *q; | ||||
char tiflist[sizeof(trusted_interfaces)]; | char tiflist[sizeof(trusted_interfaces)]; | ||||
struct mac_lomac *dest; | struct mac_lomac *dest; | ||||
int len, grade; | int len, grade; | ||||
dest = SLOT(ifplabel); | dest = SLOT(ifplabel); | ||||
if (ifp->if_type == IFT_LOOP) { | if (if_gettype(ifp) == IFT_LOOP) { | ||||
grade = MAC_LOMAC_TYPE_EQUAL; | grade = MAC_LOMAC_TYPE_EQUAL; | ||||
goto set; | goto set; | ||||
} | } | ||||
if (trust_all_interfaces) { | if (trust_all_interfaces) { | ||||
grade = MAC_LOMAC_TYPE_HIGH; | grade = MAC_LOMAC_TYPE_HIGH; | ||||
goto set; | goto set; | ||||
} | } | ||||
Show All 10 Lines | if(*p != ' ' && *p != '\t') | ||||
*q = *p; | *q = *p; | ||||
for (p = q = tiflist;; p++) { | for (p = q = tiflist;; p++) { | ||||
if (*p == ',' || *p == '\0') { | if (*p == ',' || *p == '\0') { | ||||
len = p - q; | len = p - q; | ||||
if (len < IFNAMSIZ) { | if (len < IFNAMSIZ) { | ||||
bzero(tifname, sizeof(tifname)); | bzero(tifname, sizeof(tifname)); | ||||
bcopy(q, tifname, len); | bcopy(q, tifname, len); | ||||
if (strcmp(tifname, ifp->if_xname) == 0) { | if (strcmp(tifname, if_name(ifp)) == 0) { | ||||
grade = MAC_LOMAC_TYPE_HIGH; | grade = MAC_LOMAC_TYPE_HIGH; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
else { | else { | ||||
*p = '\0'; | *p = '\0'; | ||||
printf("MAC/LOMAC warning: interface name " | printf("MAC/LOMAC warning: interface name " | ||||
"\"%s\" is too long (must be < %d)\n", | "\"%s\" is too long (must be < %d)\n", | ||||
▲ Show 20 Lines • Show All 1,845 Lines • Show Last 20 Lines |