Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Mar 2001 07:59:58 +0200 (SAT)
From:      John Hay <jhay@icomtek.csir.co.za>
To:        jhay@icomtek.csir.co.za (John Hay)
Cc:        bmilekic@technokratis.com (Bosko Milekic), freebsd-net@FreeBSD.ORG
Subject:   Re: kernel: nd6_storelladdr failed, mbuf leak
Message-ID:  <200103060559.f265xwP47418@zibbi.icomtek.csir.co.za>
In-Reply-To: <200103052003.f25K3vd32980@zibbi.icomtek.csir.co.za> from John Hay at "Mar 5, 2001 10:03:57 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> > 
> > > I have configured a 4-stable machine to be a router, routing ipv4,
> > ipv6
> > > and ipx. To be able to do Ethernet_II framing on one interface and
> > 802.3
> > > on another I have used if_ef.ko.
> > >
> > > 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.
> > 
> >     It should not be freeing the mbuf, because that mbuf is being
> > passed as an argument to ether_output(). It is typically the caller
> > that ought to be responsible for freeing the mbuf in this case.
> 
> The purpose of ether_output() is normally to get the packet (mbuf)
> onto the correct interface queue so that it will be sent out. As such
> whoever calls ether_output() is not going to do anything with that
> mbuf again. If ether_output don't put it on a queue, it should free
> it.
> 
> Well maybe I was a bit vague about the exact place. I claim that the
> return(0) at line 188 of if_ethersubr.c in -stable and line 189 in
> -current should be "goto bad" or something that will either use the
> mbuf or do a m_freem() and not just return and leave the mbuf in the
> air.
> 
> The code looks something like this:
> 
>         case AF_INET6:
>                 if (!nd6_storelladdr(&ac->ac_if, rt, m, dst, (u_char *)edst)) {
>                         /* this must be impossible, so we bark */
>                         printf("nd6_storelladdr failed\n");
> ===>                    return(0);
>                 }
> 

I can try a different route too. You don't need to believe me, you can
try it yourself. It isn't that much work.

Build and install a kernel compiled with "options IPX" and "options INET6".
Add a line
if_ef_load="YES"
to /boot/loader.conf.

Add the line
ipv6_enable="YES"
to /etc/rc.conf. (I think this should be enough even if you don't have
an ipv6 network.)

Reboot.

Login and then do the following, adjusting for your ethernet interface.
Mine is fxp0.

ifconfig fxp0f0 0x1234
ping6 ff02::%fxp0f0

You should now see "nd6_storelladdr failed" being written to your console.
Monitor your mbuf usage with "netstat -m".

John
-- 
John Hay -- John.Hay@icomtek.csir.co.za

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103060559.f265xwP47418>