if_attach should not sleep; change malloc's M_WAITOK to M_NOWAIT
This commit is contained in:
parent
d4cd548bb1
commit
10ed96fd9c
@ -423,7 +423,7 @@ if_attach(ifp)
|
||||
socksize = sizeof(*sdl);
|
||||
socksize = ROUNDUP(socksize);
|
||||
ifasize = sizeof(*ifa) + 2 * socksize;
|
||||
ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK | M_ZERO);
|
||||
ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_NOWAIT | M_ZERO);
|
||||
if (ifa) {
|
||||
sdl = (struct sockaddr_dl *)(ifa + 1);
|
||||
sdl->sdl_len = socksize;
|
||||
|
Loading…
Reference in New Issue
Block a user