Subject: Re: differences in member name
To: None <itojun@iijlab.net>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-net
Date: 08/23/1999 10:25:36
On Tue, 24 Aug 1999 01:56:05 +0900 
 itojun@iijlab.net wrote:

 > 	I'm working on KAME code which shares most of sys/netinet6 code
 > 	among all *BSDs.  I find it VERY irritating (and tend to introduce
 > 	bugs) to make #ifdef for some of very trivial differences among BSDs.
 > 	One of very good exapmle is if_list/if_link member in struct ifnet.

The name "if_list" is correct, since it indicates that the member is for
the global list of all interfaces.

 > 	NetBSD: if_list, net/if.h
 > 	FreeBSD: if_link, net/if_var.h (moved from net/if.h)
 > 	OpenBSD: if_list, net/if.h (since it was inherited from NetBSD)
 > 
 > 	Could anyone tell me why the difference is introduced?
 > 	If either of them is more authentic than others, is there any
 > 	chance for synchronization?

I seem to remember the FreeBSD camp being somewhat ... not very nice ... when
NetBSD started changing the network code to use queue.h.  Note they also
made this change after NetBSD; they could have certainly checked for
prior art.  And considering all of the other seemingly gratuitous
incompatibilities introduced by FreeBSD (e.g.  if.h -> if_var.h), I'm not
all that inclined to change the NetBSD code.

 > 	For if_list/if_link, changes are introduced in the following version:
 > NetBSD:
 > http://www.jp.netbsd.org/cgi-bin/cvsweb.cgi/syssrc/sys/net/if.h.diff?r1=1.16&r2=1.17
 > FreeBSD:
 > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/net/if.h.diff?r1=1.39&r2=1.40
 > 
 > 	My fundamental question is, why do people work on *BSDs needs to waste
 > 	their time on this kind of tiny (but very irritating) twists.
 > 	Other researchers/hackers find it troublesome.
 > 
 > itojun
 > NOTE: BSDI4 is still using if_next (not queue.h) so I omitted it
 > from the above example.  When BSDI4 changes it in the future, I hope
 > them try to use common member name.

        -- Jason R. Thorpe <thorpej@nas.nasa.gov>