Bug 168045

Summary: snort compiling fail
Product: [Fedora] Fedora Reporter: Frank Büttner <bugzilla>
Component: glibc-kernheadersAssignee: David Woodhouse <dwmw2>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: medium    
Version: 5CC: michael, redhat
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Fedora 6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-06 21:21:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank Büttner 2005-09-11 16:13:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.10) Gecko/20050717 Firefox/1.0.6

Description of problem:
When i try compiling snort i get this error:
/usr/include/linux/if.h:59: error: redefinition of `struct ifmap'
/usr/include/linux/if.h:77: error: redefinition of `struct ifreq'
/usr/include/linux/if.h:126: error: redefinition of `struct ifconf'
at the snort webpage i must read about the error:

    * Question:  I am having problems compiling snort_inline.  Here is a sample of the error messages I get during compilation:

gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../src
-I/usr/include/pcap -I../../src/output-plugins
-I../../src/detection-plugins -I../../src/preprocessors  -I/usr/include
-g -O2 -Wall -DGIDS -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD
-DHAVE_NET_ETHERNET_H -DLIBNET_LIL_ENDIAN -c `test -f 'spo_alert_fast.c'
|| echo './'`spo_alert_fast.c
In file included from /usr/include/linux/netfilter_ipv4/ip_queue.h:10,
                 from /usr/include/libipq.h:37,
                 from ../../src/inline.h:8,
                 from ../../src/snort.h:38,
                 from spo_alert_fast.c:51:
/usr/include/linux/if.h:59: redefinition of `struct ifmap'
/usr/include/linux/if.h:77: redefinition of `struct ifreq'
/usr/include/linux/if.h:126: redefinition of `struct ifconf'
make[3]: *** [spo_alert_fast.o] Error 1
make[3]: Leaving directory
`/home/matt/src/BUILD/snort-2.0.5/src/output-plugins'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/matt/src/BUILD/snort-2.0.5/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/matt/src/BUILD/snort-2.0.5'
make: *** [all] Error 2

Answer:  You need to update the kernel headers used by your glibc.  A quick fix is to create a link between /usr/include and the include directory of your kernel source.  For example, if you are trying to use this with kernel version 2.4.24, you can do the following:

cd /usr/include
mv linux linux.orig
ln -s /usr/src/linux-2.4.24/include/linux linux

Now simply go to your snort_inline directory and recompile (make clean first).

** That is, point to a set of "real" kernel includes instead of RH's glibc-kernheaders package. ** 

Version-Release number of selected component (if applicable):
glibc-kernheaders-2.4-9.1.87

How reproducible:
Always

Steps to Reproduce:
try to compile snort via rpmbuild --target i686 --with mysql --with inline --with flexresp --with mysql --rebuild snort-2.4.0-1.FC3.src.rpm

  

Actual Results:  get the error above

Expected Results:  working compiler session

Additional info:

Comment 1 Michael J Knox 2006-02-13 01:57:32 UTC
I can confirm that this still an issue on Fedora Croe 4. 

Comment 2 Christian Iseli 2007-01-20 00:46:56 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 3 Frank Büttner 2007-01-22 08:24:06 UTC
I have tested it today with snort-2.6.1.2 on FC5
same error:

/usr/include/linux/if.h:59: error: redefinition of 'struct ifmap'
/usr/include/linux/if.h:77: error: redefinition of 'struct ifreq'
/usr/include/linux/if.h:126: error: redefinition of 'struct ifconf'

Comment 4 Frank Büttner 2007-02-09 14:30:09 UTC
On FC6 it compiles without any errors.
rpmbuild -tb snort-2.6.1.2.tar.gz --with flexresp --with inline --with mysql
--define "_smp_mflags -j1"

Comment 5 Till Maas 2008-01-06 21:21:18 UTC
Fixed in Fedora 6 according to comment 4.