From fujiwara@f.rcac.tdi.co.jp  Wed Apr  5 12:05:07 2000
Return-Path: <fujiwara@f.rcac.tdi.co.jp>
Received: from f.rcac.tdi.co.jp (spacecraft.f.rcac.tdi.co.jp [202.249.17.133])
	by hub.freebsd.org (Postfix) with SMTP id 08C4A37BB76
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Apr 2000 12:05:04 -0700 (PDT)
	(envelope-from fujiwara@f.rcac.tdi.co.jp)
Received: (qmail 859 invoked by uid 0); 5 Apr 2000 19:04:58 -0000
Message-Id: <20000405190458.858.qmail@f.rcac.tdi.co.jp>
Date: 5 Apr 2000 19:04:58 -0000
From: fujiwara@rcac.tdi.co.jp
Sender: fujiwara@f.rcac.tdi.co.jp
Reply-To: fujiwara@rcac.tdi.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: sr driver ignores IFF_LINK2 | IFF_DEBUG when first time ifconfig
X-Send-Pr-Version: 3.2

>Number:         17814
>Category:       kern
>Synopsis:       sr driver ignores IFF_LINK2 | IFF_DEBUG when first time ifconfig
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jhay
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr  5 12:10:00 PDT 2000
>Closed-Date:    Tue May 16 03:49:26 PDT 2000
>Last-Modified:  Tue May 16 03:50:53 PDT 2000
>Originator:     Kazunori_Fujiwara
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
>Environment:
   4.0-RELEASE, 4.0-STABLE, 5.0-CURRENT
   PC with RISCom/N2(isa or pci) and Leased Line connection

   pseudo-device sppp
   device sr

>Description:

write to rc.conf:
  network_interfaces="sr0 ..."
  ifconfig_sr0="inet 192.168.1.1 192.168.1.2 netmask 0xfffffffc link2 debug up"

but then,
  ifconfig sr0 shows without LINK2 and DEBUB
So, CISCO_HDLC connection is not done.

>How-To-Repeat:

>Fix:

  firsttime sr_ioctl() calls sppp_attach,
    sppp_attach destroys ifp->if_flags
  So, sr_ioctl ignores LINK2 and DEBUG flags

  my temporary patch is here. (if_spppsubr.c:sr_attach())

--- sys/net/if_spppsubr.c.orig	Wed Apr  5 21:59:05 2000
+++ sys/net/if_spppsubr.c	Thu Apr  6 03:39:43 2000
@@ -801,7 +801,8 @@
 	spppq = sp;
 
 	sp->pp_if.if_mtu = PP_MTU;
-	sp->pp_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
+	sp->pp_if.if_flags &= (IFF_LINK0 | IFF_LINK1 | IFF_LINK2 | IFF_UP | IFF_DEBUG);
+	sp->pp_if.if_flags |= IFF_POINTOPOINT | IFF_MULTICAST;
 	sp->pp_if.if_type = IFT_PPP;
 	sp->pp_if.if_output = sppp_output;
 #if 0
@@ -816,6 +817,7 @@
 	sp->pp_phase = PHASE_DEAD;
 	sp->pp_up = lcp.Up;
 	sp->pp_down = lcp.Down;
+	sp->pp_mode = 0;
 
 	sppp_lcp_init(sp);
 	sppp_ipcp_init(sp);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: jhay 
State-Changed-When: Sat Apr 8 10:17:21 PDT 2000 
State-Changed-Why:  
I fixed it in rev. 1.35 of if_sr.c. Can you check if it fix it for you too, 
please? 


Responsible-Changed-From-To: freebsd-bugs->jhay 
Responsible-Changed-By: jhay 
Responsible-Changed-When: Sat Apr 8 10:17:21 PDT 2000 
Responsible-Changed-Why:  
I'll look at it. 
State-Changed-From-To: feedback->closed 
State-Changed-By: jhay 
State-Changed-When: Tue May 16 03:49:26 PDT 2000 
State-Changed-Why:  
Fixed in -current and merged to 4.0-stable. 
>Unformatted:
