tiny fix to ARCnet IPv6 support.

- in in6_ifattach_getifid(), we can grab interface id source iff the source
  is universally (worldwide) unique.  ARCnet hardware address is of 8bit and
  does not satisfy the condition.
  (in6_ifattach_getifid() is for getting interface id usable for pseudo
  interfaces like gif*)
- xx_to_eui64() should return EUI64 format, not IPv6 interface id format.
  this may seem awkward so I wish to clean these things up.
- in nd6.c, change if clause into case clause to allow future addition
  of IFT_xxx easier.
This commit is contained in:
itojun 1999-09-20 02:35:44 +00:00
parent ec9dda752e
commit 62c568fac4
2 changed files with 18 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6_ifattach.c,v 1.9 1999/09/19 21:42:23 is Exp $ */
/* $NetBSD: in6_ifattach.c,v 1.10 1999/09/20 02:35:44 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -75,6 +75,8 @@ laddr_to_eui64(dst, src, len)
case 1:
bzero(dst, 7);
dst[7] = src[0];
/* raise u bit to indicate that this is not globally unique */
dst[0] |= 0x02;
break;
case 6:
dst[0] = src[0];
@ -131,8 +133,6 @@ in6_ifattach_getifid(ifp0)
case IFT_ETHER:
case IFT_FDDI:
case IFT_ATM:
case IFT_ARCNET:
/* what others? */
/* IEEE802/EUI64 cases - what others? */
addr = LLADDR(sdl);
addrlen = sdl->sdl_alen;
@ -143,6 +143,13 @@ in6_ifattach_getifid(ifp0)
if ((addr[0] & 0x02) != 0)
break;
goto found;
case IFT_ARCNET:
/*
* ARCnet interface token cannot be used as
* globally unique identifier due to its
* small bitwidth.
*/
break;
default:
break;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: nd6.c,v 1.9 1999/09/19 21:31:35 is Exp $ */
/* $NetBSD: nd6.c,v 1.10 1999/09/20 02:35:44 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -1492,9 +1492,14 @@ nd6_output(ifp, m0, dst, rt0)
* XXX: we currently do not make neighbor cache on any interface
* other than ARCnet, Ethernet and FDDI.
*/
if (ifp->if_type != IFT_ARCNET &&
ifp->if_type != IFT_ETHER && ifp->if_type != IFT_FDDI)
switch (ifp->if_type) {
case IFT_ARCNET:
case IFT_ETHER:
case IFT_FDDI:
break;
default:
goto sendpkt;
}
/*
* next hop determination. This routine is derived from ether_outpout.