Package: bird
Severity: important
Tags: patch

Hi,

bird does not honour the source address configuration in BGP when the
interface have >1 IP address, it uses instead as source IP address the
first IP configured in such interface.

Below patch fix this problem.  Tested on big router with 9 interfaces
and many IP addresses per interface.  Global BGP table plus Internet2
BGP table.

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.19.1-cks2
Locale: LANG=es_GT.UTF-8, LC_CTYPE=es_GT.UTF-8 (charmap=UTF-8)
diff -urN --exclude debian bird-1.0.11.orig/proto/bgp/attrs.c 
bird-1.0.11/proto/bgp/attrs.c
--- bird-1.0.11.orig/proto/bgp/attrs.c  2004-06-25 10:39:54.000000000 -0600
+++ bird-1.0.11/proto/bgp/attrs.c       2007-11-20 14:35:48.000000000 -0600
@@ -576,7 +576,12 @@
   if (p->cf->next_hop_self ||
       !p->is_internal ||
       rta->dest != RTD_ROUTER)
-    *(ip_addr *)z = p->local_addr;
+    {
+      if (ipa_nonzero(p->cf->source_addr))
+        *(ip_addr *)z = p->cf->source_addr;
+      else
+        *(ip_addr *)z = p->local_addr;
+    }
   else
     *(ip_addr *)z = e->attrs->gw;
 

Reply via email to