cvs commit: src/sbin/ifconfig ifconfig.c src/sys/net if.c if.h

Brooks Davis brooks at one-eyed-alien.net
Sun Dec 12 12:52:59 PST 2004


On Sun, Dec 12, 2004 at 03:41:11PM -0500, Ken Smith wrote:
> On Sun, Dec 12, 2004 at 08:12:50PM +0000, Brooks Davis wrote:
> > brooks      2004-12-12 20:12:50 UTC
> > 
> >   FreeBSD src repository
> > 
> >   Modified files:        (Branch: RELENG_4)
> >     sbin/ifconfig        ifconfig.c 
> >     sys/net              if.c if.h 
> >   Log:
> >   MFC the addition of ifi_datalen to struct if_data and ifconfig support
> >   for it.  The change to struct if_data differs slightly from the one in
> >   5.3 in that a pad is added after ifi_xmitquota rather then adding
> >   ifi_link_state before ifi_recvquota.  This is necessicary to maintain
> >   the 4.x ABI.
> >   
> >   Revision   Changes    Path
> >   1.51.2.23  +4 -1      src/sbin/ifconfig/ifconfig.c
> >   1.85.2.28  +2 -0      src/sys/net/if.c
> >   1.58.2.12  +2 -0      src/sys/net/if.h
> 
> In if.h you are adding new fields that didn't exist before:
> 
>  #ifndef _NET_IF_H_
> @@ -97,6 +97,8 @@ struct if_data {
>  	u_char	ifi_hdrlen;		/* media header length */
>  	u_char	ifi_recvquota;		/* polling quota for receive intrs */
>  	u_char	ifi_xmitquota;		/* polling quota for xmit intrs */
> +	u_char	ifi_do_no_use;		/* pad for ifi_datalen's position */
> +	u_char	ifi_datalen;		/* length of this data struct */
>  	u_long	ifi_mtu;		/* maximum transmission unit */
>  	u_long	ifi_metric;		/* routing metric (external only) */
>  	u_long	ifi_baudrate;		/* linespeed */
> 
> So any already compiled executables that use the if_data structure would
> be looking for ifi_mtu/ifi_metric/ifi_baudrate in the wrong place after
> this change.  Are you absolutely sure this is not breaking ABI?

ifi_mtu, etc remain in the same location because the two new variables
fill in the hidden padding required to align ifi_mtu.  I've verified
that old and new ifconfigs work with old and new kernels.  The change
will allow 4.11 ifconfigs to work with 6.x if we add fields to struct
if_data (fairly probable).

-- 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/cvs-all/attachments/20041212/23a67c42/attachment.bin


More information about the cvs-all mailing list