From: osdl.net!shemminger Date: Fri, 30 Jul 2004 20:50:38 +0000 (+0000) Subject: Test for HTB version match X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lisovros/iproute2_canprio.git/commitdiff_plain/3876b3c378929488b332e857b856ed2856d54f6f Test for HTB version match (Logical change 1.59) --- diff --git a/ChangeLog b/ChangeLog index 8885fa0..001ca75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-07-30 Stephen Hemminger + * 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 diff --git a/configure b/configure index ea91719..84a87c9 100644 --- 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 < +#include +#include +$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