From owner-freebsd-net Tue Mar 6 9: 9:45 2001 Delivered-To: freebsd-net@freebsd.org Received: from VL-MS-MR002.sc1.videotron.ca (relais.videotron.ca [24.201.245.36]) by hub.freebsd.org (Postfix) with ESMTP id AF76F37B719 for ; Tue, 6 Mar 2001 09:09:37 -0800 (PST) (envelope-from bmilekic@technokratis.com) Received: from jehovah ([24.202.203.190]) by VL-MS-MR002.sc1.videotron.ca (Netscape Messaging Server 4.15) with SMTP id G9SCZ701.8VO; Tue, 6 Mar 2001 12:09:07 -0500 Message-ID: <005501c0a660$89fc2bd0$becbca18@jehovah> From: "Bosko Milekic" To: "John Hay" , Cc: References: <11354.983881225@coconut.itojun.org> Subject: Re: kernel: nd6_storelladdr failed, mbuf leak Date: Tue, 6 Mar 2001 12:11:52 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org itojun wrote: > > >> > > I then noticed that "... kernel: nd6_storelladdr failed" gets logged > >> > > often and after a while all mbufs are used. It turned out that in > >> > > sys/net/if_ethersubr.c in ether_output() when nd6_storelladdr() > >> > fails, > >> > > it does a return(0) and does not free the mbuf. I checked -current > >> > > and it is still like that. > > will correct it. thanks for reporting. > > itojun This behavior is absolutely horrible. What ought to be fixed, if ether_input() is supposed to be freeing the passed in mbuf, is that ether_input() should instead accept a pointer to a pointer so that after it frees the mbuf it can NULL out the initial pointer. Because of promoting similar existing coding practises in this area of the code, what we're seeing is ether_input() effectively returning an mbuf to the free list while the caller still holds a live pointer to that mbuf. Regards, Bosko. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message