mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-17 16:48:43 +00:00
BGP: Fix parsing of MPLS withdrawals
RFC 3107 was bit vague with regard to labeled withdrawals, RFC 8277 clarified that. The old code was incompatible with some implementations, namely with Juniper. Thanks to Vadim Fedorenko for the original patch.
This commit is contained in:
parent
daf113ac66
commit
93c1defdb0
@ -1165,9 +1165,10 @@ bgp_decode_mpls_labels(struct bgp_parse_state *s, byte **pos, uint *len, uint *p
|
|||||||
ADVANCE(*pos, *len, 3);
|
ADVANCE(*pos, *len, 3);
|
||||||
*pxlen -= 24;
|
*pxlen -= 24;
|
||||||
|
|
||||||
/* Withdraw: Magic label stack value 0x800000 according to RFC 3107, section 3, last paragraph */
|
/* RFC 8277 2.4 - withdraw does not have variable-size MPLS stack but
|
||||||
if (!a && !s->err_withdraw && (lnum == 1) && (label == BGP_MPLS_MAGIC))
|
fixed-size 24-bit Compatibility field, which MUST be ignored */
|
||||||
break;
|
if (!a && !s->err_withdraw)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
while (!(label & BGP_MPLS_BOS));
|
while (!(label & BGP_MPLS_BOS));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user