Re: 4.3: netstat question

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Toni Mueller <openbsd-misc@...>
Cc: <misc@...>
Date: Friday, June 13, 2008 - 7:20 pm

On Thu, Jun 12, 2008 at 3:47 PM, Toni Mueller wrote:

"netstat -r" dumps the routing table by calling sysctl() twice, once
to get the size of the table so that it can allocate enough memory to
hold it, and then a second call to actually fill it in. That error
means the routing table grew between the two calls, so the second call
could return the entire table.

> Any idea about how to combat this, please?

The code will need to be changed to
a) add a fudge factor to the size that was returned, and
b) retry the pair of calls if the second returns ENOMEM

I'll try to send you a patch this weekend.

Philip Guenther

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
4.3: netstat question, Toni Mueller, (Thu Jun 12, 6:47 pm)
Re: 4.3: netstat question, Philip Guenther, (Fri Jun 13, 7:20 pm)
Re: 4.3: netstat question, Claudio Jeker, (Fri Jun 13, 7:39 pm)
Re: 4.3: netstat question, Toni Mueller, (Sat Jun 14, 5:25 am)
Re: 4.3: netstat question, Henning Brauer, (Sat Jun 14, 1:11 pm)
Re: 4.3: netstat question, David Higgs, (Sat Jun 14, 7:53 pm)
Re: 4.3: netstat question, Henning Brauer, (Sat Jun 14, 9:16 pm)
Re: 4.3: netstat question, David Higgs, (Sat Jun 14, 10:55 pm)
Re: 4.3: netstat question, Claudio Jeker, (Sun Jun 15, 12:21 am)
Re: 4.3: netstat question, Philip Guenther, (Fri Jun 13, 11:28 pm)
Re: 4.3: netstat question, Pierre Riteau, (Thu Jun 12, 6:53 pm)