Skip to content

Commit

Permalink
- added the case of IFT_PPP in in6_if2idlen()
Browse files Browse the repository at this point in the history
- changed the default value of in6_if2idlen() from -1 (indicating an error)
  to 64 with making an explicit notice
  • Loading branch information
jinmei committed May 21, 2005
1 parent 598fa68 commit f520c69
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions kame/sys/netinet6/in6.c
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: in6.c,v 1.390 2005/04/26 15:42:23 jinmei Exp $ */ /* $KAME: in6.c,v 1.391 2005/05/21 00:10:58 jinmei Exp $ */


/* /*
* Copyright (c) 2002 INRIA. All rights reserved. * Copyright (c) 2002 INRIA. All rights reserved.
Expand Down Expand Up @@ -2510,18 +2510,32 @@ in6_if2idlen(ifp)
return (64); return (64);
case IFT_ISO88025: /* RFC2470 (IPv6 over Token Ring) */ case IFT_ISO88025: /* RFC2470 (IPv6 over Token Ring) */
return (64); return (64);
case IFT_PPP: /* RFC2472 */
return (64);
case IFT_ARCNET: /* RFC2497 */ case IFT_ARCNET: /* RFC2497 */
return (64); return (64);
case IFT_FRELAY: /* RFC2590 */ case IFT_FRELAY: /* RFC2590 */
return (64); return (64);
case IFT_IEEE1394: /* RFC3146 */ case IFT_IEEE1394: /* RFC3146 */
return (64); return (64);
case IFT_GIF: case IFT_GIF:
return (64); /* draft-ietf-v6ops-mech-v2-05 */ return (64); /* draft-ietf-v6ops-mech-v2-07 */
case IFT_LOOP: case IFT_LOOP:
return (64); /* XXX: is this really correct? */ return (64); /* XXX: is this really correct? */
default: default:
return (-1); /* unknown link type */ /*
* Unknown link type:
* It might be controversial to use the today's common constant
* of 64 for these cases unconditionally. For full compliance,
* we should return an error in this case. On the other hand,
* if we simply miss the standard for the link type or a new
* standard is defined for a new link type, the IFID length
* is very likely to be the common constant. As a compromise,
* we always use the constant, but make an explicit notice
* indicating the "unknown" case.
*/
printf("in6_if2idlen: unknown link type (%d)\n", ifp->if_type);
return (64);
} }
} }


Expand Down

0 comments on commit f520c69

Please sign in to comment.