modernize backfire 10.03 so it can be operational again
[openwrt-10.03/.git] / package / quagga / patches-upstream / 150-unknown_afi.patch
diff --git a/package/quagga/patches-upstream/150-unknown_afi.patch b/package/quagga/patches-upstream/150-unknown_afi.patch
new file mode 100644 (file)
index 0000000..e5e402a
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/bgpd/bgp_packet.c
++++ b/bgpd/bgp_packet.c
+@@ -1631,7 +1631,7 @@ bgp_update_receive (struct peer *peer, b
+     NLRI_TYPE_MAX,
+   };
+   struct bgp_nlri nlris[NLRI_TYPE_MAX];
+-
++  
+   /* Status must be Established. */
+   if (peer->status != Established) 
+     {
+@@ -1645,6 +1645,7 @@ bgp_update_receive (struct peer *peer, b
+   memset (&attr, 0, sizeof (struct attr));
+   memset (&extra, 0, sizeof (struct attr_extra));
+   memset (&nlris, 0, sizeof nlris);
++  
+   attr.extra = &extra;
+   s = peer->ibuf;
+@@ -1781,6 +1782,8 @@ bgp_update_receive (struct peer *peer, b
+   /* Parse any given NLRIs */
+   for (i = NLRI_UPDATE; i < NLRI_TYPE_MAX; i++)
+     {
++      if (!nlris[i].nlri) continue;
++      
+       /* We use afi and safi as indices into tables and what not.  It would
+        * be impossible, at this time, to support unknown afi/safis.  And
+        * anyway, the peer needs to be configured to enable the afi/safi