Subject: Re: netstat(1) broken for some time now
To: Rui Paulo <rpaulo@fnop.net>
From: Matt Thomas <matt@3am-software.com>
List: current-users
Date: 09/14/2006 14:44:08
Rui Paulo wrote:
> 
> On Sep 14, 2006, at 9:58 PM, Elad Efrat wrote:
> 
>> 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.
> 
> Just one more tiny note: if we change rt_metrics, rt_msghdr will also 
> change as it includes the former.
> I'm okay with changing one of the structs and bumping the kernel version.

But that changes the AF_ROUTE interface which is breaks binary compatibility.
bumping the kernel version doesn't really help.  Changing RTM_VERSION just means
that existing AF_ROUTE programs will break.  We don't want that either.  If
you want this, then enhance rtsock.c to support multiple RTM_VERSIONs.

-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.