With a Slackware 7 kernel 2.2.14 system, I notice that the client (or bird) gets the wrong broadcast address. bird> sh inter lo up (index=1) MultiAccess AdminUp LinkUp Loopback Ignored MTU=3924 127.0.0.1/8 (Primary, broadcast 127.255.255.255, scope host) eth0 up (index=10) MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500 208.135.194.18/30 (Primary, broadcast 208.135.194.255, opposite 208.135.194.19, scope univ) eth1 up (index=11) MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500 208.135.194.21/30 (Primary, broadcast 208.135.194.255, opposite 208.135.194.20, scope univ) eth2 up (index=12) MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500 208.135.194.28/29 (Primary, broadcast 208.135.194.255, scope univ) eth3 DOWN (index=13) MultiAccess Broadcast Multicast AdminUp LinkDown MTU=1500
Hello!
With a Slackware 7 kernel 2.2.14 system, I notice that the client (or bird) gets the wrong broadcast address.
bird> sh inter lo up (index=1) MultiAccess AdminUp LinkUp Loopback Ignored MTU=3924 127.0.0.1/8 (Primary, broadcast 127.255.255.255, scope host) eth0 up (index=10) MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500 208.135.194.18/30 (Primary, broadcast 208.135.194.255, opposite 208.135.194.19, scope univ) eth1 up (index=11) MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500 208.135.194.21/30 (Primary, broadcast 208.135.194.255, opposite 208.135.194.20, scope univ) eth2 up (index=12) MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500 208.135.194.28/29 (Primary, broadcast 208.135.194.255, scope univ) eth3 DOWN (index=13) MultiAccess Broadcast Multicast AdminUp LinkDown MTU=1500
Are you sure you've set the broadcast address correctly when configuring the interface? What do `ifconfig' and `ip addr' print? Have a nice fortnight -- Martin `MJ' Mares <mj@ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth "Hex dump: Where witches put used curses..."
Date: Sun, 18 Jun 2000 21:57:28 +0200 From: Martin Mares <mj@ucw.cz> Cc: bird-users@atrey.karlin.mff.cuni.cz Content-Type: text/plain; charset=us-ascii Hello!
With a Slackware 7 kernel 2.2.14 system, I notice that the client (or bird) gets the wrong broadcast address.
bird> sh inter lo up (index=1) MultiAccess AdminUp LinkUp Loopback Ignored MTU=3924 127.0.0.1/8 (Primary, broadcast 127.255.255.255, scope host) eth0 up (index=10) MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500 208.135.194.18/30 (Primary, broadcast 208.135.194.255, opposite 208.135.194.19, scope univ) eth1 up (index=11) MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500 208.135.194.21/30 (Primary, broadcast 208.135.194.255, opposite 208.135.194.20, scope univ) eth2 up (index=12) MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500 208.135.194.28/29 (Primary, broadcast 208.135.194.255, scope univ) eth3 DOWN (index=13) MultiAccess Broadcast Multicast AdminUp LinkDown MTU=1500
Are you sure you've set the broadcast address correctly when configuring the interface? What do `ifconfig' and `ip addr' print? Hmm, I thought I checked that before dropping setting the broadcast address (too many recent IP changes). I added it back in, but I'm surprised that the default isn't the last address in the net (CIDR-wise).
Hello!
Hmm, I thought I checked that before dropping setting the broadcast address (too many recent IP changes). I added it back in, but I'm surprised that the default isn't the last address in the net (CIDR-wise).
I don't know what ifconfig does use as a default, but if you use the `ip' command to set up the interfaces, default broadcast address is `none' and BIRD correctly defaults that to the last address in the net. I've added a check for broadcast address sanity to BIRD (see the patch below), so that it now complains loudly if it gets an invalid one. Have a nice fortnight -- Martin `MJ' Mares <mj@ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth "DEC = Delay in Error Correction" diff -u -r1.33 netlink.c --- sysdep/linux/netlink/netlink.c 2000/06/04 19:56:06 1.33 +++ sysdep/linux/netlink/netlink.c 2000/06/21 09:57:41 @@ -377,24 +377,28 @@ else { ip_addr netmask = ipa_mkmask(ifa.pxlen); + ip_addr xbrd; + ifa.prefix = ipa_and(ifa.ip, netmask); + ifa.brd = ipa_or(ifa.ip, ipa_not(netmask)); #ifndef IPV6 if (i->ifa_prefixlen == BITS_PER_IP_ADDRESS - 2) ifa.opposite = ipa_opposite(ifa.ip); if ((ifi->flags & IF_BROADCAST) && a[IFA_BROADCAST]) { - memcpy(&ifa.brd, RTA_DATA(a[IFA_BROADCAST]), sizeof(ifa.brd)); - ipa_ntoh(ifa.brd); + memcpy(&xbrd, RTA_DATA(a[IFA_BROADCAST]), sizeof(xbrd)); + ipa_ntoh(xbrd); + if (ipa_equal(xbrd, ifa.prefix) || ipa_equal(xbrd, ifa.brd)) + ifa.brd = xbrd; + else + log(L_ERR "KIF: Invalid broadcast address %I for %s", xbrd, ifi->name); } - else - ifa.brd = ipa_or(ifa.ip, ipa_not(netmask)); #endif - ifa.prefix = ipa_and(ifa.ip, netmask); } scope = ipa_classify(ifa.ip); if (scope < 0) { - log(L_ERR "KIF: Invalid interface address %I", ifa.ip); + log(L_ERR "KIF: Invalid interface address %I for %s", ifa.ip, ifi->name); return; } ifa.scope = scope & IADDR_SCOPE_MASK;
Date: Wed, 21 Jun 2000 12:00:30 +0200 From: Martin Mares <mj@ucw.cz>
Hmm, I thought I checked that before dropping setting the broadcast address (too many recent IP changes). I added it back in, but I'm surprised that the default isn't the last address in the net (CIDR-wise).
I don't know what ifconfig does use as a default, but if you use the `ip' command to set up the interfaces, default broadcast address is `none' and BIRD correctly defaults that to the last address in the net. ifconfig sets the last address in the Class C, not the net. I've added a check for broadcast address sanity to BIRD (see the patch below), so that it now complains loudly if it gets an invalid one. Added, and that may stop some problems.
participants (2)
-
Martin Mares -
Network Administration