NetBSD Problem Report #29790

From  Fri Mar 25 06:57:36 2005
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id A9B8D63B116
	for <>; Fri, 25 Mar 2005 06:57:35 +0000 (UTC)
Message-Id: <>
Date: Fri, 25 Mar 2005 01:56:18 -0500 (EST)
From: Chris Ross <>
Reply-To: Chris Ross <>
Subject: POINTTOPOINT IPv6 prefixlen inconsistency
X-Send-Pr-Version: 3.95

>Number:         29790
>Category:       kern
>Synopsis:       P2P interfaces act differently w.r.t. mask (IPv4 vs. IPv6)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 25 06:58:00 +0000 2005
>Originator:     Chris Ross
>Release:        NetBSD 2.0.2
System: NetBSD 2.0.2 NetBSD 2.0.2 (ROUTER.MP) #0: Fri Mar 25 00:35:52 EST 2005 i386
Architecture: i386
Machine: i386
	The kernel acts differently w.r.t. mask length of addresses applied
to P2P interfaces, depending on the IP version of the address.  It appears
to require a "prefixlen 128" for IPv6 addresses, but is content to allow
other things (e.g. /30) for IPv4 addresses.
	Create a gre interface, set the tunnel endpoints, then:
# ifconfig gre0 inet A.B.C.D/30 A.B.C.(D+1)
	...this will work.  But, if you create a gif interface,
set its tunnel endpoints, and try:
# ifconfig gif0 inet6 2001:23:2354::2:1/112 2001:23:2354::2:2
ifconfig: SIOCAIFADDR: Invalid argument

	It will do the same thing if I move the 112 into a "prefixlen"
argument.  Any prefixlen smaller than 128 causes this.
	Despite the error message, this is actually from the handling
of SIOCAIFADDR_IN6 in sys/netinet6/in6.c.  ifconfig is confusing about
this because it always reports SIOCAIFADDR, regardless of which family
it's using.
	Figure out why IPv4 p2p interfaces allow the netmask to be set
to something other than /32.  Assuming this is a sensible reason,
adjust the code in netinet6/in6.c to allow the same for IPv6.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.