Bug 43979

Summary: After a binary upgrade, kernel with ipf fails to build because of stale /usr/include/netinet/ip_fil.h
Product: Base System Reporter: Brian Candler <B.Candler>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.7-RELEASE   
Hardware: Any   
OS: Any   

Description Brian Candler 2002-10-12 17:10:01 UTC
After binary-upgrading a machine from 4.4 to 4.7, then trying to compile a kernel with 'options IPFILTER', the compile fails:

cc -c -O -pipe  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions -ansi  -nostdinc -I- -I. -I../.. -I/usr/include -I../../contrib/ipfilter  -D_KERNEL -include opt_global.h -elf  -mpreferred-stack-boundary=2  ../../contrib/ipfilter/netinet/fil.c
./../contrib/ipfilter/netinet/fil.c: In function 'fr-Makefrip':
./../contrib/ipfilter/netinet/fil.c:267: structure has no member named 'fin_misc'
./../contrib/ipfilter/netinet/fil.c:287: 'ICMP6_MINLEN' undeclared (first use in this function)
./../contrib/ipfilter/netinet/fil.c: In function 'fr_check':
./../contrib/ipfilter/netinet/fil.c:1082: too few arguments to function 'ipfw_newfrag'
./../contrib/ipfilter/netinet/fil.c:1092: too many arguments to function 'fr_addstate'
*** Error code 1

Problem is due to a stale file /usr/include/netinet/ip_fil.h which takes precedence over the correct version, due to the sequence of -I flags.

I was able to fix the problem by rm -rf /usr/include and untarring
/usr/include from bin.??, crypto.??, krb4.?? and krb5.??

Fix: 

(1) Re-order the flags on the cc command line so that -I../../contrib/ipfilter comes before -I/usr/include ?

(2) During binary upgrade, have a list of files which were known to belong
to previous versions of FreeBSD but no longer exist, and remove or rename them???
Comment 1 Kris Kennaway freebsd_committer freebsd_triage 2003-07-13 01:27:44 UTC
State Changed
From-To: open->closed

Stale header files are known to cause compilation failures. 
You should periodically clean out your /usr/include if you 
track FreeBSD development.