if_data size issues

Brooks Davis brooks at one-eyed-alien.net
Wed Sep 1 15:20:16 PDT 2004


On Wed, Sep 01, 2004 at 02:50:13PM -0700, Julian Elischer wrote:
> 
> >My recent commit to net/if.h adding ifi_epoch to struct if_data had
> >unintended consequences.  Specifically, because of the way ifconfig
> >uses RTM_IFINFO routing socket messages via sysctl to obtain interface
> >information, the value of sizeof(struct if_data) must be the same in the
> >kernel and userland.  I have committed a fix from Peter which allows
> >ifconfig to handle growth of struct if_data.  Unfortunately, this does
> >not fix old ifconfigs with new kernels.
> 
> What is the reason that ifi_epoch needs to be accurate the microsecond?
> you have a u)long just next door that is unused that could hold a 
> seconds count that would last
> at least 68 years if expressed as a count from boot time.

It probably doesn't need to be, but that only puts off the problem by
using the last remaining space.  I initially used struct timeval because
that's what ifi_lastchange used.

If we decied to go this route, I'd be inclined to turn that variable
into a time_t since it's the right width or smaller on all architectures
(I believe struct padding will take care of the extra space on alpha,
but we'll need to check).  Bumping time_t to 64-bit on 32-bit arches
will break the ABI will break due to ifi_lastchange so that's not a
consideration.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20040901/e917831c/attachment.bin


More information about the freebsd-arch mailing list