From owner-freebsd-current Sun Jul 15 8:13:32 2001 Delivered-To: freebsd-current@freebsd.org Received: from peace.mahoroba.org (peace.calm.imasy.or.jp [202.227.26.34]) by hub.freebsd.org (Postfix) with ESMTP id CA29337B405; Sun, 15 Jul 2001 08:13:21 -0700 (PDT) (envelope-from ume@mahoroba.org) Received: from localhost (IDENT:/M4qi+yn9uZXApUdmq3hyph/y1X0dKpgjNqoGKKKaUVJ+S7Z4ex+2eFlSxc4C369@localhost [::1]) (authenticated as ume with CRAM-MD5) by peace.mahoroba.org (8.11.4/8.11.4/peace) with ESMTP/inet6 id f6FFDIo35936; Mon, 16 Jul 2001 00:13:18 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Mon, 16 Jul 2001 00:13:14 +0900 (JST) Message-Id: <20010716.001314.59549708.ume@mahoroba.org> To: net@FreeBSD.org, current@FreeBSD.org Subject: Use of M_WAITOK in if_addmulti(). From: Hajimu UMEMOTO In-Reply-To: <20010715120317.A99869@fump.kawo2.rwth-aachen.de> References: <20010715120317.A99869@fump.kawo2.rwth-aachen.de> X-Mailer: Mew version 1.95b119 on Emacs 20.7 / Mule 4.0 =?iso-2022-jp?B?KBskQjJWMWMbKEIp?= X-PGP-Public-Key: http://www.imasy.org/~ume/publickey.asc X-PGP-Fingerprint: 6B 0C 53 FC 5D D0 37 91 05 D0 B3 EF 36 9B 6A BC X-URL: http://www.imasy.org/~ume/ X-Operating-System: FreeBSD 5.0-CURRENT Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, Current if_addmulti() calls MALLOC() with M_WAITOK. However, if_addmulti() can be called from in[6]_addmulti() with splnet(). It may lead kernel panic. So, I wish to change to use M_NOWAIT. Any comment? Index: sys/net/if.c diff -u sys/net/if.c.orig sys/net/if.c --- sys/net/if.c.orig Wed Jul 4 20:28:47 2001 +++ sys/net/if.c Sun Jul 15 23:47:15 2001 @@ -1412,8 +1412,8 @@ llsa = 0; } - MALLOC(ifma, struct ifmultiaddr *, sizeof *ifma, M_IFMADDR, M_WAITOK); - MALLOC(dupsa, struct sockaddr *, sa->sa_len, M_IFMADDR, M_WAITOK); + MALLOC(ifma, struct ifmultiaddr *, sizeof *ifma, M_IFMADDR, M_NOWAIT); + MALLOC(dupsa, struct sockaddr *, sa->sa_len, M_IFMADDR, M_NOWAIT); bcopy(sa, dupsa, sa->sa_len); ifma->ifma_addr = dupsa; @@ -1441,9 +1441,9 @@ ifma->ifma_refcount++; } else { MALLOC(ifma, struct ifmultiaddr *, sizeof *ifma, - M_IFMADDR, M_WAITOK); + M_IFMADDR, M_NOWAIT); MALLOC(dupsa, struct sockaddr *, llsa->sa_len, - M_IFMADDR, M_WAITOK); + M_IFMADDR, M_NOWAIT); bcopy(llsa, dupsa, llsa->sa_len); ifma->ifma_addr = dupsa; ifma->ifma_ifp = ifp; -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message