From nobody@FreeBSD.org  Sat Apr 14 06:57:06 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 8996416A482
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 14 Apr 2007 06:57:06 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 7EE9213C480
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 14 Apr 2007 06:57:06 +0000 (UTC)
	(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 l3E6v629058982
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 14 Apr 2007 06:57:06 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l3E6q42N058605;
	Sat, 14 Apr 2007 06:52:04 GMT
	(envelope-from nobody)
Message-Id: <200704140652.l3E6q42N058605@www.freebsd.org>
Date: Sat, 14 Apr 2007 06:52:04 GMT
From: "Eugene M. Zheganin"<emz@norma.perm.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: link1 flag doesn't work as intended when specified in startup scripts
X-Send-Pr-Version: www-3.0

>Number:         111557
>Category:       conf
>Synopsis:       [gre] link1 flag doesn't work as intended when specified in startup scripts
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 14 07:00:09 GMT 2007
>Closed-Date:    
>Last-Modified:  Sat Jun 27 05:50:00 UTC 2009
>Originator:     Eugene M. Zheganin
>Release:        6.2-RELEASE
>Organization:
Norma JSC.
>Environment:
FreeBSD bsd.niiums.perm.ru 6.2-RELEASE FreeBSD 6.2-RELEASE #2: Thu Jan 25 16:13:06 YEKT 2007     emz@bsd.niiums.perm.ru:
/usr/obj/usr/src/sys/NIIUMS  i386
>Description:
'link1' flag doesn't work as intended when configured for gre tunnel
using main system config files:

- when configured via ifconfig_gre0="" with all appropriate parameters
  the interface does appear with 'LINK1' flag, but requires an additional
  'ifconfig gre link1' command for the tunnel to start working;

- when configured via 'start_if.gre0' script with all additional parameters,
  for example

===Cut===
#!/bin/sh

/sbin/ifconfig gre0 192.168.1.1 192.168.1.2 netmask 255.255.255.255 10.10.10.1 10.10.10.5 mtu 1480
# even when sleep 10
sleep 10
/sbin/ifconfig gre0 link1
===Cut==

the system still requires 'ifconfig gre0 link1' for the tunnel to start working;
>How-To-Repeat:
Create a gre tunnel with link1 set in configuration files; in rc.conf
or even in start_if.gre0.
Reboot the machine.
Try to ping remote.
>Fix:
echo gre_enable="YES" >> /etc/rc.conf
echo gre_flags="greX link1" >> /etc/rc.conf

(according to your configuration)

and place the following script to /usr/local/etc/rc.d/:

#!/bin/sh
#

#
# gre startup script by drookie, 14/04/2007 12:38
# to avoid link1 bug when it is configured in earlier scripts :/
#
# PROVIDE: gre
# REQUIRE: LOGIN NETWORKING
#
#

name=gre
command=/sbin/ifconfig
gre_enable=${gre_enable:-"NO"}

. /etc/rc.subr
rcvar=`set_rcvar`
load_rc_config ${name}

run_rc_command "$1"
>Release-Note:
>Audit-Trail:

From: Cristian KLEIN <cristi@net.utcluj.ro>
To: bug-followup@FreeBSD.org,  emz@norma.perm.ru
Cc:  
Subject: Re: conf/111557: [gre] link1 flag doesn't work as intended when specified
 in startup scripts
Date: Thu, 19 Jul 2007 02:40:43 +0300

 I have no problem with that in 7.0-CURRENT from 2007-07-17.
 

From: =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0JbQtdCz0LDQvdC40L0=?=
 <eugene@zhegan.in>
To: bug-followup@FreeBSD.org, emz@norma.perm.ru
Cc:  
Subject: Re: conf/111557: [gre] link1 flag doesn't work as intended when specified
 in startup scripts
Date: Sat, 27 Jun 2009 11:25:04 +0600

 FreeBSD 7.2 is still affected.
>Unformatted:
