This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: Why does PPP failed at adding default route every other time?
- From: "Weili Yao" <weili_yao at trimble dot com>
- To: "Matt Jerdonek" <maj1224 at yahoo dot com>, <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 21 Nov 2005 12:19:09 -0800
- Subject: RE: [ECOS] Why does PPP failed at adding default route every other time?
Matt:
Thanks for the info.
I traced the error path and found that I hit the ENOBUFS at the
following place:
Packages/net/bsd_tcpip/current/src/sys/net/rtsock.c line 351
Error = rtrequest(RTM_ADD, dst, gate, netmask,
rtm->rtm_flags, &saved_nrt);
Here rtrequest() is defined in
packages/net/bsd_tcpip/current/src/sys/net/route.c line 656:
:
R_Malloc(rt, struct rtentry *, sizeof(*rt));
if (rt == 0)
senderr(ENOBUFS);
In our .ecc file, we have defined CYG_NET_MEM_USAGE to 400000 (i.e.,
256K). We suspected that maybe this memory size is too small, so I
simply double the size to 800000 (512KB), and my problem is gone.
Now the questions are:
Before the increase of CYG_NET_MEM_USAGE, where is the memory used?
Why did I get successful malloc() every other time? What is typical
value of CYG_NET_MEM_USAGE? How to turn on log(LOG_MDEBUG, ...) so that
I can print out memory usage trace?
Thank you!
Weili
-----Original Message-----
From: Matt Jerdonek [mailto:maj1224@yahoo.com]
Sent: Thursday, November 17, 2005 6:40 PM
To: Weili Yao; ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] Why does PPP failed at adding default route every
other time?
From packages/error/current/include/codes.h, 355 means
ENOBUFS. My guess is that the malloc is failing in
rtrequest, but unfortunately I'm not sure about that,
nor can I tell you why the malloc is failing. You'll
probably have to step through it to find exactly where
the failure is.
-- Matt
--- Weili Yao <weili_yao@trimble.com> wrote:
> The errno is 355 after the write() function got
> executed.
> Thanks!
>
> Weili
>
> -----Original Message-----
> From: Matt Jerdonek [mailto:maj1224@yahoo.com]
> Sent: Thursday, November 17, 2005 3:46 PM
> To: Weili Yao; ecos-discuss@sources.redhat.com
> Subject: Re: [ECOS] Why does PPP failed at adding
> default route every
> other time?
>
> What are you getting for the errno?
>
> --- Weili Yao <weili_yao@trimble.com> wrote:
>
> > Does anybody know why PPP failed to add default
> > route every other time?
> >
> > The failure is at file
> > net/ppp/current/src/sys-ecos.c, function
> > dodefaultroute(). It failed at write().
> >
> > When PPP is successfully established at the first
> > time, the default
> > route can be successfully added. Then I
> disconnected
> > the PPP, and
> > established the PPP again at the second time, then
> > the default route
> > adding failed. If I re-established the PPP at the
> > third time, the
> > default route adding is success. The default route
> > adding failed at
> > every other time.
> >
> > I noticed that when I disconnected PPP, the
> default
> > route got correctly
> > deleted.
> >
> > Thank you very much for your help.
> >
> > Weili Yao
> >
> >
> > --
> > Before posting, please read the FAQ:
> > http://ecos.sourceware.org/fom/ecos
> > and search the list archive:
> > http://ecos.sourceware.org/ml/ecos-discuss
> >
> >
>
>
>
>
> __________________________________
> Yahoo! FareChase: Search multiple travel sites in
> one click.
> http://farechase.yahoo.com
>
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss