PeerA sets `dont-capability-negotiate` for PeerB. It does not send any
capabilities to PeerB. This leads to situation when PeerA received AS4 cap,
while it doesn't send AS4 to PeerB and tries parsing AS_PATH using 32bits.
[GTTPK-RX2GP][EC
33554436] Malformed AS path from 192.168.0.2, length is 4
[SM0KX-WXMGK] bgp_attr_malformed: attributes: , origin ?
[P7TRR-4J6XT][EC
33554487] 192.168.0.2: Attribute AS_PATH, parse error - treating as withdrawal
[WX70K-6XXVF][EC
33554454] 192.168.0.2 rcvd UPDATE with errors in attr(s)!! Withdrawing route.
[Z2KFR-ZGJC8] 192.168.0.2 rcvd UPDATE w/ attr: , origin ?
[P9VY3-5B6NX] 192.168.0.2 rcvd UPDATE wlen 0 attrlen 80 alen 73
[QMZ79-K2DH7][EC
33554454] 192.168.0.2 [Error] Update packet error (wrong prefix length 64 for afi 1)
[P9SYB-54XRZ][EC
33554454] 192.168.0.2 [Error] Error parsing NLRI
[V1CHF-JSGRR] %NOTIFICATION: sent to neighbor 192.168.0.2 3/10 (UPDATE Message Error/Invalid Network Field) 0 bytes
[HTHRX-GQYGJ][EC
33554454] bgp_process_packet: BGP UPDATE receipt failed for peer: 192.168.0.2
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* peer with AS4 => will get 4Byte ASnums
* otherwise, will get 16 Bit
*/
- attr->aspath = aspath_parse(peer->curr, length,
- CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV));
+ attr->aspath = aspath_parse(
+ peer->curr, length,
+ CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV)
+ && CHECK_FLAG(peer->cap, PEER_CAP_AS4_ADV));
/* In case of IBGP, length will be zero. */
if (!attr->aspath) {
struct aspath *aspath;
int send_as4_path = 0;
int send_as4_aggregator = 0;
- bool use32bit = CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV);
+ bool use32bit = CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV)
+ && CHECK_FLAG(peer->cap, PEER_CAP_AS4_ADV);
if (!bgp)
bgp = peer->bgp;