diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2005-08-02 17:52:52 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2005-08-02 17:52:52 +0000 |
commit | 09df718e0e96b21e3df2f8bab13e88e0211b074a (patch) | |
tree | d84acad36832edb2c3e80231f2c82d8289e533ff /sys/net/if_arcsubr.c | |
parent | de6073aab059e5f382e1b8887d12a79074abce28 (diff) | |
download | src-09df718e0e96b21e3df2f8bab13e88e0211b074a.tar.gz src-09df718e0e96b21e3df2f8bab13e88e0211b074a.zip |
When allocating link layer ifnet address list entries in
ifp->if_resolvemulti(), do so with M_NOWAIT rather than M_WAITOK, so
that a mutex can be held over the call. In the FDDI code, add a
missing M_ZERO. Consumers are already aware that if_resolvemulti()
can fail.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=148641
Diffstat (limited to 'sys/net/if_arcsubr.c')
-rw-r--r-- | sys/net/if_arcsubr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c index e944f495a4f4..09a672ff3604 100644 --- a/sys/net/if_arcsubr.c +++ b/sys/net/if_arcsubr.c @@ -798,7 +798,9 @@ arc_resolvemulti(ifp, llsa, sa) if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) return EADDRNOTAVAIL; MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR, - M_ZERO); + M_NOWAIT | M_ZERO); + if (sdl == NULL) + return ENOMEM; sdl->sdl_len = sizeof *sdl; sdl->sdl_family = AF_LINK; sdl->sdl_index = ifp->if_index; @@ -824,7 +826,9 @@ arc_resolvemulti(ifp, llsa, sa) if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) return EADDRNOTAVAIL; MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR, - M_ZERO); + M_NOWAIT | M_ZERO); + if (sdl == NULL) + return ENOMEM; sdl->sdl_len = sizeof *sdl; sdl->sdl_family = AF_LINK; sdl->sdl_index = ifp->if_index; |