MP_UNREACH_NLRI RFC8277 compatibility

Vadim Fedorenko vadimjunk at gmail.com
Fri Jun 29 15:26:46 CEST 2018


Hi!
According to RFC 8277, NLRI for withdrawal contains 3 fields: Length,
Compatibility and Prefix.
"Upon transmission, the Compatibility field SHOULD be set to 0x800000.Upon
reception, the value of the Compatibility field MUST be ignored."
Right now, BIRD 2.0.2 checks Compatibility field for value 0x800000, and
this is not compatible with RFC, and at least Juniper MX do not set this
field to 0x800000, and BGP session between BIRD and Juniper resets with
Malformed Attribute List.
Attached patch fixes this behavior.

diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index 190fd6f..5dcb00d 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -1165,8 +1165,11 @@ bgp_decode_mpls_labels(struct bgp_parse_state *s,
byte **pos, uint *len, uint *p
     ADVANCE(*pos, *len, 3);
     *pxlen -= 24;

-    /* Withdraw: Magic label stack value 0x800000 according to RFC 3107,
section 3, last paragraph */
-    if (!a && !s->err_withdraw && (lnum == 1) && (label == BGP_MPLS_MAGIC))
+    /*
+     * Withdraw: According to RFC 3107, section 2.4, second paragraph
+     * Upon reception, the value of the Compatibility field MUST be
ignored.
+     */
+    if (!a && !s->err_withdraw && (lnum == 1) && (s->mp_unreach_len))
       break;
   }
   while (!(label & BGP_MPLS_BOS));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20180629/2432019a/attachment.html>


More information about the Bird-users mailing list