summaryrefslogtreecommitdiffstats
path: root/proto/bgp
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-05-06 15:18:52 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-05-06 15:18:52 +0200
commit10ab65a8c9eb846655feacd22c29747743a65328 (patch)
tree75b4a03395d480d3ad1e39ef7ec0d7a0d8de1efe /proto/bgp
parentb7a735ea9d14ceb5c31712fbe122b54f0d7ec6e7 (diff)
downloadbird-10ab65a8c9eb846655feacd22c29747743a65328.tar
bird-10ab65a8c9eb846655feacd22c29747743a65328.zip
Fixes one recently introduced IPv6 BGP compatibility problem.
Diffstat (limited to 'proto/bgp')
-rw-r--r--proto/bgp/packets.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index f244e3c..27adc16 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -305,14 +305,25 @@ bgp_create_update(struct bgp_conn *conn, byte *buf)
* in the same interface, we should also send a link local
* next hop address. We use the received one (stored in the
* other part of BA_NEXT_HOP eattr). If we didn't received
- * it (for example it is a static route), we do not send link
- * local next hop address. It is contrary to RFC 2545, but
- * probably the only sane possibility.
+ * it (for example it is a static route), we can't use
+ * 'third party' next hop and we have to use local IP address
+ * as next hop. Sending original next hop address without
+ * link local address seems to be a natural way to solve that
+ * problem, but it is contrary to RFC 2545 and Quagga does not
+ * accept such routes.
*/
n = neigh_find(&p->p, &ip, 0);
if (n && n->iface == p->neigh->iface)
- ip_ll = ipp[1];
+ {
+ if (ipa_nonzero(ipp[1]))
+ ip_ll = ipp[1];
+ else
+ {
+ ip = p->source_addr;
+ ip_ll = p->local_link;
+ }
+ }
}
if (ipa_nonzero(ip_ll))