Subject: kern/11830: lo0 dosn't have IFF_RUNNING flag bit set.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jasper@pointless.net>
List: netbsd-bugs
Date: 12/27/2000 16:44:13
>Number:         11830
>Category:       kern
>Synopsis:       lo0 dosn't have the IFF_RUNNING flag bit set.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 27 16:44:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Jasper Wallace
>Release:        1.5_ALPHA2
>Organization:
>Environment:
	i386 laptop.
System: NetBSD jellycat.pointless.net 1.5_ALPHA2 NetBSD 1.5_ALPHA2 (JELLYCAT.pnpbios) #6: Fri Sep 15 02:00:50 BST 2000 jasper@jellycat:/usr/src/sys/arch/i386/compile/JELLYCAT.pnpbios i386


>Description:
	lo0 under netbsd dosn't have the IFF_RUNNING bit set, it probably
should.
	I'm writing some php + snmp web pages for monitering vairous boxes,
and noticed that ucd-snmp maps IFF_RUNNING to ifAdminStatus and IFF_UP to
ifOperStatus, (which imho is the wrong way round). Since netbsd dosn't set
IFF_RUNNING on lo0 ifAdminStatus is set to down which makes it look like lo0
has been ifconfig'd down.

fwiw both Solaris 2.6 and FreeBSD 3.4-RELEASE have IFF_RUNNING on lo0.

>How-To-Repeat:
	look at the output of 'ifconfig lo0'
>Fix:
	
(not tested).

--- if_loop.c.bak	Thu Dec 28 00:23:07 2000
+++ if_loop.c	Thu Dec 28 00:25:52 2000
@@ -347,7 +347,7 @@
 	switch (cmd) {
 
 	case SIOCSIFADDR:
-		ifp->if_flags |= IFF_UP;
+		ifp->if_flags |= ( IFF_UP | IFF_RUNNING);
 		ifa = (struct ifaddr *)data;
 		if (ifa != 0 /*&& ifa->ifa_addr->sa_family == AF_ISO*/)
 			ifa->ifa_rtrequest = lortrequest;

>Release-Note:
>Audit-Trail:
>Unformatted: