On Mon, Feb 21, 2005 at 01:02:48PM +1000, Anthony Towns wrote:
> Michael Banck wrote:
> >the following patch makes ifupdown installable on GNU/Hurd and
> >(supposedly) GNU/k*BSD. net-tools is not available for those arches (and
> >inetutils-tools is not quite there yet). Also, the test suite fails on
> >hurd-i386,
>
> Err, then the test suite needs to be fixed to work on hurd. That's not
> negotiable :)
Of course, even more so when we try to have a buildd.
> >so I added support to not run it if the 'nocheck' variable is
> >found in DEB_BUILD_OPTIONS.
>
> The test suite's pretty trivial; I don't think a 'nocheck' is worthwhile.
OK, your call.
> >debian/testbuild: line 113: 21025 Segmentation fault
> > ./ifup -nv --force -a -i tests/testcase.$test
> >tests/up-res-out.$test 2>tests/up-res-err.$test
>
> That's not good, in particular. That doesn't seem like a test suite bug;
> rather a bug in the original code, your changes, or the Hurd being fux0red.
So this looks like a problem with operating system deducing code, namely
in mylinuxver(). u->release is '0.3' on GNU/Hurd, while it is something
like '2.6.10-2-386' on GNU/Linux, resulting in a segfault when trying to
split at the second (non-existent) '.'.
This patch fixes this:
--- ifupdown.nw.orig 2005-02-21 13:41:57.000000000 +0100
+++ ifupdown.nw 2005-02-21 13:41:25.000000000 +0100
@@ -3664,10 +3664,10 @@
char *pch;
uname(&u);
maj = atoi(u.release);
- pch = strchr(u.release, '.');
- rev = atoi(pch+1);
- pch = strchr(pch+1, '.');
- min = atoi(pch+1);
+ if (pch = strchr(u.release, '.'))
+ rev = atoi(pch+1);
+ if (pch = strchr(pch+1, '.'))
+ min = atoi(pch+1);
}
return mylinux(maj,rev,min);
However, the test suite now fails due to:
[EMAIL PROTECTED]:~/build/ifupdown-0.6.4$ ./ifup -nv --force -a -i
tests/testcase.1
Configuring interface eth0=eth0 (inet)
Don't seem to be have all the variables for eth0/inet.
At this point, my gdb-fu with this tangled source stuff has left me, so
I'd value your advice on how to debug this.
It might be due to the fact that inetutils-tools' ifconfig has a
different output than net-tools:
[EMAIL PROTECTED]:~/build/ifupdown-0.6.4$ ifconfig -i eth0
eth0 (2):
inet address 192.168.0.95
netmask 255.255.255.0
broadcast 192.168.0.255
flags UP BROADCAST RUNNING MULTICAST
mtu 1500
thanks,
Michael
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]