Re: Bird 1.5.0: protocol 'direct' looses routes

2015-06-16 Thread Andrew

16.06.2015 22:40, Ondrej Zajicek пишет:

On Tue, Jun 16, 2015 at 03:20:25PM +0300, Andrew wrote:

Thanks for the example, it is very descriptive. The problem here is that
'direct' protocol is a stateless translation of address announcements to
route announcements, but routing tables do not consider interface as part
of route key, therefore only one route for a prefix is remembered and
I will write a patch for this.

Yes, it'll be great.

You could try attached patch


Thanks, it works.

Also, with 1.5.0 I have long OSPF initialization (near 2 minutes - 1.4.5 
and quagga starts much faster). I have OSPF debug log; should I attach 
it to mail (does mailing list supports attaches), or should I send it to 
your personal mail?


Re: Bird 1.5.0: protocol 'direct' looses routes

2015-06-16 Thread Ondrej Zajicek
On Tue, Jun 16, 2015 at 03:20:25PM +0300, Andrew wrote:
 
 Thanks for the example, it is very descriptive. The problem here is that
 'direct' protocol is a stateless translation of address announcements to
 route announcements, but routing tables do not consider interface as part
 of route key, therefore only one route for a prefix is remembered and
 I will write a patch for this.

 Yes, it'll be great.

You could try attached patch

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
To err is human -- to blame it on a computer is even more so.
diff --git a/nest/rt-dev.c b/nest/rt-dev.c
index 87ffc5e..f6bc143 100644
--- a/nest/rt-dev.c
+++ b/nest/rt-dev.c
@@ -51,7 +51,10 @@ dev_ifa_notify(struct proto *p, unsigned c, struct ifa *ad)
 	  DBG(dev_if_notify: device shutdown: prefix not found\n);
 	  return;
 	}
-  rte_update(p, n, NULL);
+
+  /* Use iface ID as local source ID */
+  struct rte_src *src = rt_get_source(p, ad-iface-index);
+  rte_update2(p-main_ahook, n, NULL, src);
 }
   else if (c  IF_CHANGE_UP)
 {
@@ -61,8 +64,11 @@ dev_ifa_notify(struct proto *p, unsigned c, struct ifa *ad)
 
   DBG(dev_if_notify: %s:%I going up\n, ad-iface-name, ad-ip);
 
+  /* Use iface ID as local source ID */
+  struct rte_src *src = rt_get_source(p, ad-iface-index);
+
   rta a0 = {
-	.src = p-main_source,
+	.src = src,
 	.source = RTS_DEVICE,
 	.scope = SCOPE_UNIVERSE,
 	.cast = RTC_UNICAST,
@@ -75,7 +81,7 @@ dev_ifa_notify(struct proto *p, unsigned c, struct ifa *ad)
   e = rte_get_temp(a);
   e-net = n;
   e-pflags = 0;
-  rte_update(p, n, e);
+  rte_update2(p-main_ahook, n, e, src);
 }
 }
 


signature.asc
Description: Digital signature


Re: Bird 1.5.0: protocol 'direct' looses routes

2015-06-16 Thread Ondrej Zajicek
On Tue, Jun 16, 2015 at 01:39:24PM +0300, Andrew wrote:
 13.06.2015 10:43, Andrew пишет:
 Hi all.
 
 I'm testing bird 1.5.0 on PPPoE BRAS, and today noticed that sometimes it
 looses routes. For ex., today it looses near 5 networks of 103 total
 (before restart - it has 98 routes, after - 103)
 
 Possibly this may be related with tunnel session hangup - when user
 reconnects with same IP and then old session is dropped, bird may loose
 this route while route is present in system. But I'm not sure about this.
 
 Trouble is confirmed on test machine.
 
 Testing result:

Hi

Thanks for the example, it is very descriptive. The problem here is that
'direct' protocol is a stateless translation of address announcements to
route announcements, but routing tables do not consider interface as part
of route key, therefore only one route for a prefix is remembered and
later removed. We could fix that in a similar way how BGP add path is
implemented - using separate route source per iface id. In that case, if
you have the same network on more interfaces, direct protocol will
generate multiple routes which will compete for being the best route.
I will write a patch for this.

BTW, the protocol 'loses' not 'looses' routes.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
To err is human -- to blame it on a computer is even more so.


signature.asc
Description: Digital signature