Subject: Re: EUI64 patch for ifconfig.c
To: None <>
From: None <>
List: tech-net
Date: 06/14/2002 08:16:56
>There has been some discussion on various lists recently
>about making it possible to cause ifconfig to automatically
>calculate the appropriate IPv6 address to use, given a 
>prefix. I guess there are differing opinions about where
>such functionality belongs. In any case, below is a patch
>that makes it possible to do something like:
># ifconfig hme0 inet6 3ffe:1cdc:0:1234:: eui64
>and have the lower 64 bits of the address filled in
>for you.
>Is the consensus that this is something useful and good,
>or misguided and inappropriate?

	couple of points:
	- the code duplicates logic in sys/netinet6/in6_ifattach.c.  it would
	  be much better if you pick interface ID from link-local address on
	  the interface.  for instance, you can't use this code for p2p
	  interface.  ifconfig(8) is supposed to be more generic.
	- don't forget freeifaddrs(3).

	- if we directly pick sockaddr_dl from the kernel:
		- you really need to check interface type (IFT_xx) to do this.
		  sdl_alen == 8 (or 6) does not indicate EUI64/MAC.
		- you forgot to flip universal/local bit (another reason not to
		  pick sockaddr_dl from the kernel).
		- you forgot to check multicast bit. (ditto)

	i personally am not in favor of this, but thanks for your patch.
	let me think about it.