Bug 168045 - snort compiling fail
Summary: snort compiling fail
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc-kernheaders   
(Show other bugs)
Version: 5
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: David Woodhouse
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2005-09-11 16:13 UTC by Frank Büttner
Modified: 2008-01-06 21:21 UTC (History)
2 users (show)

Fixed In Version: Fedora 6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-06 21:21:18 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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
-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
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):

How reproducible:

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 ?


Comment 3 Frank Büttner 2007-01-22 08:24:06 UTC
I have tested it today with snort- 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- --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.

Note You need to log in before you can comment on or make changes to this bug.