OSPF bug?

Mark Glines mark at glines.org
Sat Nov 24 23:32:31 CET 2001


Hi!  We've been attempting to use bird 1.0.5 on our test network,
but OSPF didn't seem to be propogating correctly.  Rather, it was
talking amongst its peer routers properly, and propogating routes
correctly, but forgetting to set the gateways (which kinda defeats
the purpose).

For instance, we have one machine (test1, 192.168.0.254) which is
directly attached to 192.168.0.0/24 (obviously) and 192.168.1.0/24,
as well as our uplink to the internet.  Another machine
(192.168.0.60) is directly attached to 192.168.0.0/24 (obviously),
192.168.4.0/24 and 192.168.7.0/24.

Once they had flooded LS's and entered OSPF "full" mode with
eachother, test1's routing table looked like:

test1:~# ip route
XXX.XXX.XXX.XXX/27 dev eth0  proto kernel  scope link  src XXX.XXX.XXX.XXX
192.168.7.0/24 dev eth2  proto bird
192.168.4.0/24 dev eth2  proto bird
192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.254
192.168.0.0/24 dev eth2  proto kernel  scope link  src 192.168.0.254
default via XXX.XXX.XXX.XXX dev eth0  proto bird



I rooted around in the source for a while, and managed to make it work.
Attached is the patch (which also includes a small documentation fix).
This patch makes bird set gateways properly:

test1:~# ip route
XXX.XXX.XXX.XXX/27 dev eth0  proto kernel  scope link  src XXX.XXX.XXX.XXX
192.168.7.0/24 via 192.168.0.60 dev eth2  proto bird
192.168.4.0/24 via 192.168.0.60 dev eth2  proto bird
192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.254
192.168.0.0/24 dev eth2  proto kernel  scope link  src 192.168.0.254
default via XXX.XXX.XXX.XXX dev eth0  proto bird



Since this seems like such a silly bug and is so unlikely to be
overlooked (because it rendered bird's OSPF mostly useless), I have
to ask if we configured something wrong, or managed to mess something
else up.  Please also find attached one of our config files (they all
look pretty similar to this).  What happened?  I'd love to hear your
comments.

Thanks for your time,
Mark
-------------- next part --------------
diff -uNr bird-pristine/doc/bird.sgml bird-1.0.5/doc/bird.sgml
--- bird-pristine/doc/bird.sgml	Sun Sep  3 11:25:26 2000
+++ bird-1.0.5/doc/bird.sgml	Sat Nov 24 14:04:39 2001
@@ -1320,8 +1320,8 @@
 <p>In addition to options common for all to other protocols, RIP supports the following ones:
 
 <descrip>
-	<tag/authentication none|password|md5/ selects authentication method to be used. <cf/none/ means that
-	  packets are not authenticated at all, <cf/password/ means that a plaintext password is embedded
+	<tag/authentication none|plaintext|md5/ selects authentication method to be used. <cf/none/ means that
+	  packets are not authenticated at all, <cf/plaintext/ means that a plaintext password is embedded
 	  into each packet, and <cf/md5/ means that packets are authenticated using a md5 cryptographic
 	  hash. If you set authentication to not-none, it is a good idea to add <cf>passwords { }</cf>
 	  section. Default: none.
diff -uNr bird-pristine/proto/ospf/rt.c bird-1.0.5/proto/ospf/rt.c
--- bird-pristine/proto/ospf/rt.c	Sat Jun  9 08:09:00 2001
+++ bird-1.0.5/proto/ospf/rt.c	Sat Nov 24 14:01:44 2001
@@ -195,7 +195,7 @@
     else
     {
       /* Update routing table */
-      if(nf->en->nhi==NULL)
+      if(nf->en->nh==ipa_from_u32(0))
       {
         struct top_hash_entry *en=nf->en;
         struct ospf_neighbor *neigh;
-------------- next part --------------
protocol direct {
}
protocol kernel {
    scan time 10;
    export all;
}
protocol device {
    scan time 10;
}
protocol static {
	preference 1;
	route 0.0.0.0/0 via XXX.XXX.XXX.XXX;
}
protocol rip {
    interface "eth*" {
        mode broadcast;
        metric 0;
    };
    interface "tap*" {
        mode broadcast;
        metric 5;
    };
    authentication plaintext;
    passwords { password "XXXXXX"; }
    honor neighbor;
}
protocol ospf {
    export filter {
		if source = RTS_STATIC then {
			ospf_metric1 = 50;
			accept;
		}
		reject;
	};
	area 0.0.0.0 {
        tick 2;
        interface "eth1" {
            cost 1;
            hello 9;
            retransmit 6;
            dead count 5;
            wait 30;
            type broadcast;
            authentication simple;
            password "XXXXXX";
        };
        interface "eth2" {
            cost 1;
            hello 9;
            retransmit 6;
            dead count 5;
            wait 30;
            type broadcast;
            authentication simple;
            password "XXXXXX";
        };
    };
}


More information about the Bird-users mailing list