From eugene@kabir.zssm.zp.ua  Fri Apr 19 12:46:44 2002
Return-Path: <eugene@kabir.zssm.zp.ua>
Received: from kabir.zssm.zp.ua (kabir.zssm.zp.ua [212.8.32.6])
	by hub.freebsd.org (Postfix) with ESMTP id 285D437B404
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 19 Apr 2002 12:46:40 -0700 (PDT)
Received: (from eugene@localhost)
	by kabir.zssm.zp.ua (8.9.3/8.9.3) id WAA18269;
	Fri, 19 Apr 2002 22:45:42 +0300 (EEST)
	(envelope-from eugene)
Message-Id: <200204191945.WAA18269@kabir.zssm.zp.ua>
Date: Fri, 19 Apr 2002 22:45:42 +0300 (EEST)
From: Eugene Polovnikov <eugene@kabir.zssm.zp.ua>
Reply-To: eugene@kabir.zssm.zp.ua
To: FreeBSD-gnats-submit@freebsd.org
Subject: kernel is not linking without "device ether" in the config
X-Send-Pr-Version: 3.2

>Number:         37261
>Category:       kern
>Synopsis:       (pr: 33833): [patch] kernel is not linking without "device ether" in the config
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    remko
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 19 12:50:03 PDT 2002
>Closed-Date:    Sat Jan 27 19:03:32 GMT 2007
>Last-Modified:  Sat Jan 27 19:03:32 GMT 2007
>Originator:     Eugene Polovnikov
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:


>Description:
    kernel is not linking without "device ether" in the kernel's config
>How-To-Repeat:
	delete "device ether" and all drivers of ethernet NIC's from kernel's config
	and try to build new kernel

	

>Fix:
--- if.c.old    Fri Apr 19 22:29:22 2002
+++ if.c        Fri Apr 19 22:29:44 2002
@@ -1599,7 +1599,7 @@
                ifp->if_flags |= IFF_UP;
				ifr.ifr_flags = ifp->if_flags;
				(*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr);
-#ifdef INET
+#if NETHER > 0
				/*
				 * Also send gratuitous ARPs to notify other nodes about
				 * the address change.

	

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->luigi 
Responsible-Changed-By: cjc 
Responsible-Changed-When: Sun Apr 21 01:35:29 PDT 2002 
Responsible-Changed-Why:  
It was a change by luigi that introduced this problem. Is the 
submitted (simple) fix really a fix, luigi? 

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

From: Ruslan Ermilov <ru@FreeBSD.org>
To: Luigi Rizzo <luigi@FreeBSD.org>
Cc:  
Subject: kern/37261
Date: Sat, 28 Sep 2002 16:01:27 +0300

 Hi Luigi!
 
 Could you please take a look at PR 37261?
 
 The suggested fix is incorrect, and the correct
 fix for 4.x would be to check for:
 
 #if defined(INET) && (NETHER > 0)
 
 The analogous check for 5.0, where there's no NETHER
 defined by config(8), is to use something like
 ip_fw_chk_ptr (the below is only compile-tested):
 
 %%%
 Index: sys/net/if.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/net/if.c,v
 retrieving revision 1.148
 diff -u -p -r1.148 if.c
 --- sys/net/if.c	19 Aug 2002 17:20:03 -0000	1.148
 +++ sys/net/if.c	28 Sep 2002 12:48:42 -0000
 @@ -75,6 +75,7 @@
  #endif
  #ifdef INET
  #include <netinet/if_ether.h>
 +void	(*arp_ifinit_ptr)(struct ifnet *, struct ifaddr *);
  #endif
  
  static int	ifconf(u_long, caddr_t);
 @@ -1948,10 +1949,11 @@ if_setlladdr(struct ifnet *ifp, const u_
  		 * Also send gratuitous ARPs to notify other nodes about
  		 * the address change.
  		 */
 +		if (arp_ifinit_ptr != NULL)
  		TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
  			if (ifa->ifa_addr != NULL &&
  			    ifa->ifa_addr->sa_family == AF_INET)
 -				arp_ifinit(ifp, ifa);
 +				(*arp_ifinit_ptr)(ifp, ifa);
  		}
  #endif
  	}
 Index: sys/netinet/if_ether.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/netinet/if_ether.c,v
 retrieving revision 1.96
 diff -u -p -r1.96 if_ether.c
 --- sys/netinet/if_ether.c	31 Jul 2002 16:45:16 -0000	1.96
 +++ sys/netinet/if_ether.c	28 Sep 2002 12:24:00 -0000
 @@ -950,6 +950,7 @@ arp_init(void)
  	arpintrq.ifq_maxlen = 50;
  	mtx_init(&arpintrq.ifq_mtx, "arp_inq", NULL, MTX_DEF);
  	LIST_INIT(&llinfo_arp);
 +	arp_ifinit_ptr = arp_ifinit;
  	register_netisr(NETISR_ARP, arpintr);
  }
  
 Index: sys/netinet/if_ether.h
 ===================================================================
 RCS file: /home/ncvs/src/sys/netinet/if_ether.h,v
 retrieving revision 1.27
 diff -u -p -r1.27 if_ether.h
 --- sys/netinet/if_ether.h	24 Mar 2002 10:19:10 -0000	1.27
 +++ sys/netinet/if_ether.h	28 Sep 2002 12:48:17 -0000
 @@ -117,6 +117,7 @@ extern struct	ifqueue arpintrq;
  int	arpresolve(struct ifnet *, struct rtentry *, struct mbuf *,
  	    struct sockaddr *, u_char *, struct rtentry *);
  void	arp_ifinit(struct ifnet *, struct ifaddr *);
 +extern void	(*arp_ifinit_ptr)(struct ifnet *, struct ifaddr *);
  #endif
  
  #endif
 %%%
 
 -- 
 Ruslan Ermilov		Sysadmin and DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: bug-followup@freebsd.org
Cc: maxim@freebsd.org, luigi@freebsd.org, ru@freebsd.org
Subject: Re: kern/37261
Date: Sun, 2 Mar 2003 00:01:31 +0700

 Hi!
 
 Any chance this PR and related kern/33833 will be closed before 4.8-RELEASE?
 
 Eugene Grosbein
State-Changed-From-To: open->feedback 
State-Changed-By: remko 
State-Changed-When: Sun Dec 31 11:09:14 UTC 2006 
State-Changed-Why:  
This probably did not make it into 4.8, do you happen to 
know whether this ever was committed in one form or the 
other?. Please note that i also linked the PR to the 
other PR I just put in feedback mode, this way it's 
easier to track in the topic. 

Reference: PR/33833 


Responsible-Changed-From-To: luigi->remko 
Responsible-Changed-By: remko 
Responsible-Changed-When: Sun Dec 31 11:09:14 UTC 2006 
Responsible-Changed-Why:  
Grab the PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37261 
State-Changed-From-To: feedback->closed 
State-Changed-By: remko 
State-Changed-When: Sat Jan 27 19:03:29 UTC 2007 
State-Changed-Why:  
no feedback had been recieved 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37261 
>Unformatted:
