Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/if.c
Show First 20 Lines • Show All 3,194 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct ifconf *ifc = (struct ifconf *)data; | struct ifconf *ifc = (struct ifconf *)data; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
struct ifaddr *ifa; | struct ifaddr *ifa; | ||||
struct ifreq ifr; | struct ifreq ifr; | ||||
struct sbuf *sb; | struct sbuf *sb; | ||||
int error, full = 0, valid_len, max_len; | int error, full = 0, valid_len, max_len; | ||||
/* Limit initial buffer size to MAXPHYS to avoid DoS from userspace. */ | /* Limit initial buffer size to maxphys to avoid DoS from userspace. */ | ||||
max_len = MAXPHYS - 1; | max_len = maxphys - 1; | ||||
/* Prevent hostile input from being able to crash the system */ | /* Prevent hostile input from being able to crash the system */ | ||||
if (ifc->ifc_len <= 0) | if (ifc->ifc_len <= 0) | ||||
return (EINVAL); | return (EINVAL); | ||||
again: | again: | ||||
if (ifc->ifc_len <= max_len) { | if (ifc->ifc_len <= max_len) { | ||||
max_len = ifc->ifc_len; | max_len = ifc->ifc_len; | ||||
▲ Show 20 Lines • Show All 1,342 Lines • Show Last 20 Lines |