Subject: Re: netstat(1) broken for some time now
To: None <current-users@netbsd.org>
From: Elad Efrat <elad@NetBSD.org>
List: current-users
Date: 09/14/2006 22:58:12
Rui Paulo wrote:

> Ask Elad:
> #ifdef notyet /* XXX elad */
>         printf("%6d %8ld ", (int)rtm->rtm_rmx.rmx_refcnt,
>             rtm->rtm_rmx.rmx_pksent);
> #endif

There are several issues with this bit, aside the fact the variable
names are just incorrect for the old behavior.

First, these variables are just incorrect for the old usage. We should
be using 'rt_refcnt' and 'rt_use'.

Also, we previously would read the rtentry directly; now we don't. We
don't pass anything that can be used as 'refcnt'. We need to add a
variable for that in either 'rt_msghdr' or 'rt_metrics'.

Then, we *do* pass something that can be used for the 'Use' field, but
the types for 'rt_use' (u_long) and 'rtm_use' (int) differ.

The code to solve it is really simple; I'm just not sure what would be
the implications of adding a new variable in (one of) the struct(s) we
pass and/or changing the type for one of the 'use' variables.

-e.

-- 
Elad Efrat