| Summary: | (pr: 33833): [patch] kernel is not linking without "device ether" in the config | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Eugene Polovnikov <eugene> | ||||
| Component: | kern | Assignee: | Remko Lodder <remko> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | CC: | galasten | ||||
| Priority: | Normal | ||||||
| Version: | 4.5-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Eugene Polovnikov
2002-04-19 20:50:03 UTC
Responsible Changed From-To: freebsd-bugs->luigi It was a change by luigi that introduced this problem. Is the submitted (simple) fix really a fix, luigi? 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
Hi! Any chance this PR and related kern/33833 will be closed before 4.8-RELEASE? Eugene Grosbein State Changed From-To: open->feedback 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 Grab the PR State Changed From-To: feedback->closed no feedback had been recieved In FreeBSD 11.1 (i386) same problem appeared: --- kernel --- linking kernel if.o: In function `if_etherbpfmtap': /usr/src/sys/net/if.c:(.text+0x624f): undefined reference to `ether_vlan_mtap' *** [kernel] Error code 1 In FreeBSD 10.3 was ok. |