[Snort-devel] [ snort-Bugs-701984 ] configure.in: bad test for libnet version

SourceForge.net noreply at ...12...
Wed Mar 12 06:11:16 EST 2003


Bugs item #701984, was opened at 2003-03-12 05:09
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=103357&aid=701984&group_id=3357

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: NN Poster (nnposter)
Assigned to: Nobody/Anonymous (nobody)
Summary: configure.in: bad test for libnet version

Initial Comment:
Test for proper libnet version (version 1.0.2a) via parsing 
libnet.h in
configure.in is broken when a user wishes to use --with-
libnet-includes to
specify a custom location. The test is working correctly 
if the user has
functional libnet-config or the libraries are in one of the 
common locations.

There are really two bugs here:

A simple bug is that the code is referencing iterator $i 
from non-existent loop
while it should be using $LIBNET_INC_DIR in both 
FAIL_MESSAGE macros. No true
functionality is broken but the user is being lied about 
what failed.

A more serious issue is that the logic of the versioning 
test is broken as well.
The current logic is:

	if I have found libnet.h
	then
	  if the version is not 1.0.2a
	  then: tell the user that the library cannot be 
found
	  else: call it a success
	else
	  tell the use the library is of wrong version

The intended logic is:

	if I have found libnet.h
	then
	  if the version is not 1.0.2a
	  then: tell the use the library is of wrong 
version
	  else: call it a success
	else
	  tell the user that the library cannot be found



(relevance: snort 1.9.1, build 233, packaged as snort-
stable as of 3/11/03)

--- configure.in  2003-03-03 11:13:10.000000000 -0700
+++ configure.in.new      2003-03-11 
20:49:57.000000000 -0700
@@ -844,16 +844,17 @@

     if test "$LIBNET_INC_DIR" != ""; then
       if eval "grep LIBNET_VERSION 
$LIBNET_INC_DIR/libnet.h | grep -v 1.0.2a >/dev/null"; 
then
-        FAIL_MESSAGE("libnet 1.0.2a (libnet.h)", $i)
+        AC_MSG_RESULT(no)
+        echo
+        echo "   ERROR!  Snort with --flexresp will *only* 
work with libnet"
+        echo "   version 1.0.2a, go get it from"
+        echo "   
http://www.packetfactory.net/projects/libnet/"
+        FAIL_MESSAGE("libnet 1.0.2a (libnet.h)", 
$LIBNET_INC_DIR)
       fi
       AC_MSG_RESULT(yes)
     else
       AC_MSG_RESULT(no)
-      echo
-      echo "   ERROR!  Snort with --flexresp will *only* 
work with libnet"
-      echo "   version 1.0.2a, go get it from"
-      echo "   
http://www.packetfactory.net/projects/libnet/"
-      FAIL_MESSAGE("libnet 1.0.2a (libnet.h)", $i)
+      FAIL_MESSAGE("libnet 1.0.2a (libnet.h)", 
$LIBNET_INC_DIR)
     fi

     LNET=""


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=103357&aid=701984&group_id=3357




More information about the Snort-devel mailing list