Snort mailing list archives

Re: Snort 1.81-RELEASE, libnet 1.0.2a and FlexResp: not compiling


From: Skip Carter <skip () taygeta com>
Date: Fri, 31 Aug 2001 17:45:59 -0700


I noticed that a similar problem has been reported several times with
earlier versions of Snort and OpenBSD. I found no reports about
1.81-RELEASE, so here we go again:

I'm trying to compile Snort 1.81-RELEASE in a clean OpenBSD 2.9 box with
libpcap 0.6.2 and libnet 1.0.2a installed. Here's what I get when trying
to compile Snort (after './configure --with-mysql --enable-flexresp'):

======================================================================

gcc -DHAVE_CONFIG_H -I. -I. -I.   -I/usr/local/include/mysql
-DENABLE_MYSQL -DENABLE_SSL -I/usr/include  -g -O2 -Wall
-DENABLE_RESPONSE -DLIBNET_BSDISH_OS -DLIBNET_LIL_ENDIAN -c sp_respond.c
In file included from snort.h:54,
                 from sp_respond.h:23,
                 from sp_respond.c:35:
/usr/include/net/if.h:80: redefinition of `struct if_data'
/usr/include/net/if.h:116: redefinition of `struct ifnet_head'
/usr/include/net/if.h:125: redefinition of `struct ifnet'
/usr/include/net/if.h:149: redefinition of `struct ifqueue'
/usr/include/net/if.h:251: redefinition of `struct ifaddr'
/usr/include/net/if.h:272: redefinition of `struct ifprefix'
/usr/include/net/if.h:284: redefinition of `struct if_msghdr'
/usr/include/net/if.h:298: redefinition of `struct ifa_msghdr'
/usr/include/net/if.h:314: redefinition of `struct ifreq'
/usr/include/net/if.h:334: redefinition of `struct ifaliasreq'
/usr/include/net/if.h:342: redefinition of `struct ifmediareq'
/usr/include/net/if.h:359: redefinition of `struct ifconf'
/usr/include/net/if.h:372: redefinition of `struct if_laddrreq'
/usr/include/net/if.h:381: redefinition of `struct if_nameindex'
In file included from /usr/include/net/if.h:395,
                 from snort.h:54,
                 from sp_respond.h:23,
                 from sp_respond.c:35:
/usr/include/net/if_arp.h:49: redefinition of `struct arphdr'
/usr/include/net/if_arp.h:79: redefinition of `struct arpreq'
*** Error code 1

Stop in /root/Setup/snort-1.81/snort-1.8.1-RELEASE.

======================================================================

Is there a fix yet?

The problem is that in the long chain of includes, <net/if.h> is getting
included more than once.

The fix is to put a guard in /usr/include/net/if.h against it getting
used more than once.

i.e. put in the beginning of that file:

#ifndef NET_IF_H_
#define NET_IF_H_

and then at the end:

#endif


(This is really a mistake the OpenBSD and not really snorts problem)

 
-- 
 Dr. Everett (Skip) Carter      Phone: 831-641-0645 FAX:  831-641-0647
 Taygeta Scientific Inc.        INTERNET: skip () taygeta com
 1340 Munras Ave., Suite 314    UUCP:     ...!uunet!taygeta!skip
 Monterey, CA. 93940            WWW: http://www.taygeta.com/skip.html












_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
http://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users


Current thread: