From c1e12ca979c08a19f20afb4dc70dfa4fd7a52a48 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Tue, 28 Jul 2015 23:29:04 +0800 Subject: [PATCH] mcast: Use M_INTWAIT for multicast addresses allocation --- sys/net/if.c | 8 ++++---- sys/netinet/in.c | 2 +- sys/netinet6/in6.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 0d1f20acd9..f8e765570e 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2439,8 +2439,8 @@ if_addmulti_serialized(struct ifnet *ifp, struct sockaddr *sa, llsa = NULL; } - ifma = kmalloc(sizeof *ifma, M_IFMADDR, M_WAITOK); - dupsa = kmalloc(sa->sa_len, M_IFMADDR, M_WAITOK); + ifma = kmalloc(sizeof *ifma, M_IFMADDR, M_INTWAIT); + dupsa = kmalloc(sa->sa_len, M_IFMADDR, M_INTWAIT); bcopy(sa, dupsa, sa->sa_len); ifma->ifma_addr = dupsa; @@ -2462,8 +2462,8 @@ if_addmulti_serialized(struct ifnet *ifp, struct sockaddr *sa, if (ifma) { ifma->ifma_refcount++; } else { - ifma = kmalloc(sizeof *ifma, M_IFMADDR, M_WAITOK); - dupsa = kmalloc(llsa->sa_len, M_IFMADDR, M_WAITOK); + ifma = kmalloc(sizeof *ifma, M_IFMADDR, M_INTWAIT); + dupsa = kmalloc(llsa->sa_len, M_IFMADDR, M_INTWAIT); bcopy(llsa, dupsa, llsa->sa_len); ifma->ifma_addr = dupsa; ifma->ifma_ifp = ifp; diff --git a/sys/netinet/in.c b/sys/netinet/in.c index f9cb0453a5..51ea05d0c8 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1330,7 +1330,7 @@ in_addmulti(struct in_addr *ap, struct ifnet *ifp) if (ifma->ifma_protospec != NULL) return ifma->ifma_protospec; - inm = kmalloc(sizeof *inm, M_IPMADDR, M_WAITOK | M_ZERO); + inm = kmalloc(sizeof *inm, M_IPMADDR, M_INTWAIT | M_ZERO); inm->inm_addr = *ap; inm->inm_ifp = ifp; inm->inm_ifma = ifma; diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 600f12f777..e772db5bed 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1746,7 +1746,7 @@ in6_addmulti(struct in6_addr *maddr6, struct ifnet *ifp, int *errorp) return ifma->ifma_protospec; } - in6m = kmalloc(sizeof(*in6m), M_IPMADDR, M_WAITOK | M_ZERO); + in6m = kmalloc(sizeof(*in6m), M_IPMADDR, M_INTWAIT | M_ZERO); in6m->in6m_addr = *maddr6; in6m->in6m_ifp = ifp; in6m->in6m_ifma = ifma; -- 2.41.0