From nobody@FreeBSD.org  Tue May  9 03:43:24 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 472D816A403
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  9 May 2006 03:43:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 61EBC43D6D
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  9 May 2006 03:43:21 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k493hLTr004860
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 9 May 2006 03:43:21 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k493hKqt004855;
	Tue, 9 May 2006 03:43:21 GMT
	(envelope-from nobody)
Message-Id: <200605090343.k493hKqt004855@www.freebsd.org>
Date: Tue, 9 May 2006 03:43:21 GMT
From: TANABE Hiroyasu <h@cosat.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: gifconfig_gif? in rc.conf does not recognize IPv6 address
X-Send-Pr-Version: www-2.3

>Number:         97014
>Category:       conf
>Synopsis:       [gif] gifconfig_gif? in rc.conf does not recognize IPv6 address
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 09 03:50:18 GMT 2006
>Closed-Date:    
>Last-Modified:  Thu Nov 18 06:20:07 UTC 2010
>Originator:     TANABE Hiroyasu
>Release:        6.1-RELEASE
>Organization:
Cosat Inc.
>Environment:
FreeBSD fw7.zeon2k.g.cosat.com 6.1-RELEASE FreeBSD 6.1-RELEASE #3: Mon May  8 04:38:55 JST 2006     h@fw7.zeon2k.g.cosat.com:/usr/obj/usr/src/sys/COSATFW3  i386

>Description:
My FreeBSD box has a "IPv4 over IPv6" tunnel.

It was configured in 5.4-RELEASE by rc.conf shown below:
  gif_interfaces="YES"
  gif_interfaces="gif0"
  gifconfig_gif0="2001:DB8:0001::1 2001:DB8:0001::2"
  ifconfig_gif0="inet 192.0.2.1 netmask 0xffffffff 192.0.2.2"

But it does not work in 6.1-RELEASE.

It seemes to be caused by a difference of /sbin/ifconfig.

>How-To-Repeat:
'ifconfig gif0 tunnel 2001:DB8:0001::1 2001:DB8:0001::2' 
works in FreeBSD 5.4.

The command does not work in FreeBSD 6.1 with error:
`ifconfig: SIOCSIFPHYADDR: Address family not supported by protocol family`

>Fix:
Now I'm using a local script shown below,
but I think /etc/network.subr should be revised.
--------
#!/bin/sh
#

# PROVIDE: gifipv6
# REQUIRE: root mountcritlocal netif
# BEFORE:  routing
# KEYWORD: nojail

. /etc/rc.subr

name="gifipv6"
rcvar=`set_rcvar`
load_rc_config $name
start_cmd="gif_ipv6_start"

gif_ipv6_start()
{
        case ${gif_interfaces} in
        [Nn][Oo] | '')
                ;;
        *)
                for i in ${gif_interfaces}; do
                        eval peers=\$gifv6config_$i
                        case ${peers} in
                        '')
                                continue
                                ;;
                        *)
                                ifconfig $i create >/dev/null 2>&1
                                ifconfig $i inet6 tunnel ${peers}
                                ifconfig $i up
                                ;;
                        esac
                done
                ;;
        esac
}

run_rc_command "$1"

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: matteo 
State-Changed-When: Wed May 17 12:25:15 UTC 2006 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=97014 
State-Changed-From-To: feedback->open 
State-Changed-By: matteo 
State-Changed-When: Wed May 17 12:26:51 UTC 2006 
State-Changed-Why:  
Reset status to open: I set it to feedback 'cause I mistyped PR number 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97014 
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: brucec 
Responsible-Changed-When: Sun Nov 14 20:35:21 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97014 

From: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To: bug-followup@FreeBSD.org, h@cosat.com
Cc:  
Subject: Re: conf/97014: [gif] gifconfig_gif? in rc.conf does not recognize
 IPv6 address
Date: Thu, 18 Nov 2010 06:11:48 +0000 (UTC)

 Put an "inet6" in front of the addresses, like you would do for
 ifconfig.
 
 - gifconfig_gif0="2001:DB8:0001::1 2001:DB8:0001::2"
 + gifconfig_gif0="inet6 2001:DB8:0001::1 2001:DB8:0001::2"
 
 does that help?
>Unformatted:
