]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Test for HTB version match
authorosdl.net!shemminger <osdl.net!shemminger>
Fri, 30 Jul 2004 20:50:38 +0000 (20:50 +0000)
committerosdl.net!shemminger <osdl.net!shemminger>
Fri, 30 Jul 2004 20:50:38 +0000 (20:50 +0000)
(Logical change 1.59)

ChangeLog
configure

index 8885fa0346c291ba44665d3cbaa362f89ad07db5..001ca7504e68383b526af05febed80057f795f59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-07-30  Stephen Hemminger  <shemminger@osdl.org>
 
+       * HTB API changed and won't build with mismatched version.
+         Rather than sticking user with a build error, just don't
+         build it in on mismatch.
+
        * Change configure script to make sure netem is the correct
          version. I changed the structure def. a couple of times before
          settling on the final API
index ea91719b2e7f102d51bf2146713873d944c4b211..84a87c9791ea28cc3ab3a2dfb040f8c00b4daab2 100644 (file)
--- a/configure
+++ b/configure
@@ -51,10 +51,35 @@ else
 fi
 rm -f /tmp/atmtest.c /tmp/atmtest
 
+echo -n " HTB...              "
+DEF_HTB=`grep '^#define HTB_TC_VER' tc/q_htb.c`
+cat >/tmp/htbtest.c <<EOF
+#include <stdio.h>
+#include <asm/types.h>
+#include <linux/pkt_sched.h>
+$DEF_HTB
+int main(int argc, char **argv) {
+       if (HTB_TC_VER >>16 != TC_HTB_PROTOVER) {
+               fprintf(stderr, "different kernel and TC HTB versions\n");
+               return 1;
+       } 
+       return 0;
+}
+EOF
+gcc -I$INCLUDE -o /tmp/htbtest /tmp/htbtest.c
+if [ $? -eq 0 -a /tmp/htbtest ]
+then
+       echo "TC_CONFIG_HTB:=y" >>Config
+       echo y
+else
+    echo n
+fi
+rm -f /tmp/htbtest /tmp/htbtest.c
+
 # See if we know about TCP Vegas
 echo "SS"
 echo -n " TCP Vegas...        "
-if grep -q TCPDIAG_VEGASINFO $INCLUDE/linux/tcp_diag.h
+if grep -q TCPDIAG_VEGASINFO $INCLUDE/linux/tcp_diag.h  >/dev/null 2>&1
 then
     echo "SS_CONFIG_VEGAS:=y" >>Config
     echo y