Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Sep 2004 11:58:22 +0200 (CEST)
From:      Harti Brandt <harti@freebsd.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        arch@freebsd.org
Subject:   Re: if_data size issues
Message-ID:  <20040902113909.M26182@beagle.kn.op.dlr.de>
In-Reply-To: <413665EA.30003@elischer.org>
References:  <20040901193445.GC12483@odin.ac.hmc.edu> <41364415.9040708@elischer.org> <20040902000637.GA4120@odin.ac.hmc.edu> <413665EA.30003@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 1 Sep 2004, Julian Elischer wrote:

JE>
JE>
JE>Brooks Davis wrote:
JE>
JE>> On Wed, Sep 01, 2004 at 02:50:13PM -0700, Julian Elischer wrote:
JE>>  
JE>> > Brooks Davis wrote:
JE>> > 
JE>> >    
JE>> > > My recent commit to net/if.h adding ifi_epoch to struct if_data had
JE>> > > unintended consequences.  Specifically, because of the way ifconfig
JE>> > > uses RTM_IFINFO routing socket messages via sysctl to obtain interface
JE>> > > information, the value of sizeof(struct if_data) must be the same in
JE>> > > the
JE>> > > kernel and userland.  I have committed a fix from Peter which allows
JE>> > > ifconfig to handle growth of struct if_data.  Unfortunately, this does
JE>> > > not fix old ifconfigs with new kernels.
JE>> > >      
JE>> > What is the reason that ifi_epoch needs to be accurate the microsecond?
JE>> > you have a u)long just next door that is unused that could hold a seconds
JE>> > count that would last
JE>> > at least 68 years if expressed as a count from boot time.
JE>> >    
JE>> 
JE>> I dug into the RFCs and found that ifCounterDiscontinuityTime is of type
JE>> TimeStamp which is a TimeTick with the epoch of sysUpTime.  The
JE>> resolution of a TimeTick is 1/100s.  Thus, given our choice of counters,
JE>> struct timeval is most appropriate.  However, in this case, meeting the
JE>> letter of the rule is arguably unnecessary.
JE>> 
JE>> Given the pain this change is causing and the limited impact of reducing
JE>> the precision of ifi_epoch, I propose the following:
JE>> 
JE>> - Back out the ifi_epoch addition.
JE>> - MT5 and MT4 Peter's size change.
JE>> - Turn ifi_unused into ifi_epoch.
JE>> - After 5.3 is released, declare that upgrades to 6.0 from releases
JE>>   other then 4.x (x>=11) and 5.y (y>=3) require special handling and
JE>>   allow if_data to grow as demand requires.
JE>> - If additional precision is deemed necessary at some future date,
JE>>   add a second ifi_epoch_tv.
JE>> 
JE>
JE>sounds ok to me except that it should actually work from 4.x and 5.2 for a
JE>while.. say 6 months or so..
JE>a lot of people run along the -current branch but don't upgrade every day..
JE>after 6 months or so probably most of them will have moved onto something
JE>that can cope.
JE>
JE>Are there consumers of this info other than ifconfig?   netstat? natd? route?
JE>etc?

The SNMP MIB-II module would happily use it I suppose 
(contrib/bsnmp/snmp_mibII).

harti



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