Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/ip_dummynet.c
Show First 20 Lines • Show All 2,510 Lines • ▼ Show 20 Lines | ip_dn_ctl(struct sockopt *sopt) | ||||
case IP_DUMMYNET_FLUSH: | case IP_DUMMYNET_FLUSH: | ||||
case IP_DUMMYNET_CONFIGURE: | case IP_DUMMYNET_CONFIGURE: | ||||
case IP_DUMMYNET_DEL: /* remove a pipe or queue */ | case IP_DUMMYNET_DEL: /* remove a pipe or queue */ | ||||
case IP_DUMMYNET_GET: | case IP_DUMMYNET_GET: | ||||
D("dummynet: compat option %d", sopt->sopt_name); | D("dummynet: compat option %d", sopt->sopt_name); | ||||
error = ip_dummynet_compat(sopt); | error = ip_dummynet_compat(sopt); | ||||
break; | break; | ||||
case IP_DUMMYNET3 : | case IP_DUMMYNET3: | ||||
if (sopt->sopt_dir == SOPT_GET) { | if (sopt->sopt_dir == SOPT_GET) { | ||||
error = dummynet_get(sopt, NULL); | error = dummynet_get(sopt, NULL); | ||||
break; | break; | ||||
} | } | ||||
l = sopt->sopt_valsize; | l = sopt->sopt_valsize; | ||||
if (l < sizeof(struct dn_id) || l > 12000) { | if (l < (int)sizeof(struct dn_id) || l > 12000) { | ||||
D("argument len %d invalid", l); | D("argument len %d invalid", l); | ||||
break; | break; | ||||
} | } | ||||
p = malloc(l, M_TEMP, M_NOWAIT); | p = malloc(l, M_TEMP, M_NOWAIT); | ||||
if (p == NULL) { | if (p == NULL) { | ||||
error = ENOMEM; | error = ENOMEM; | ||||
break; | break; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 321 Lines • Show Last 20 Lines |