mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 02:30:52 +00:00
Merge pull request #15690 from FRRouting/mergify/bp/stable/9.1/pr-15640
bgpd: Fix errors handling for MP/GR capabilities as dynamic capability (backport #15640)
This commit is contained in:
commit
45021ae829
@ -3121,6 +3121,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
|||||||
zlog_err("%pBP: Capability length error", peer);
|
zlog_err("%pBP: Capability length error", peer);
|
||||||
bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE,
|
bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE,
|
||||||
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
||||||
|
pnt += length;
|
||||||
return BGP_Stop;
|
return BGP_Stop;
|
||||||
}
|
}
|
||||||
action = *pnt;
|
action = *pnt;
|
||||||
@ -3133,7 +3134,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
|||||||
action);
|
action);
|
||||||
bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE,
|
bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE,
|
||||||
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
||||||
return BGP_Stop;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bgp_debug_neighbor_events(peer))
|
if (bgp_debug_neighbor_events(peer))
|
||||||
@ -3145,12 +3146,13 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
|||||||
zlog_err("%pBP: Capability length error", peer);
|
zlog_err("%pBP: Capability length error", peer);
|
||||||
bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE,
|
bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE,
|
||||||
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
||||||
|
pnt += length;
|
||||||
return BGP_Stop;
|
return BGP_Stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ignore capability when override-capability is set. */
|
/* Ignore capability when override-capability is set. */
|
||||||
if (CHECK_FLAG(peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY))
|
if (CHECK_FLAG(peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY))
|
||||||
continue;
|
goto done;
|
||||||
|
|
||||||
capability = lookup_msg(capcode_str, hdr->code, "Unknown");
|
capability = lookup_msg(capcode_str, hdr->code, "Unknown");
|
||||||
|
|
||||||
@ -3165,7 +3167,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
|||||||
peer, capability,
|
peer, capability,
|
||||||
sizeof(struct capability_mp_data),
|
sizeof(struct capability_mp_data),
|
||||||
hdr->length);
|
hdr->length);
|
||||||
return BGP_Stop;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&mpc, pnt + 3, sizeof(struct capability_mp_data));
|
memcpy(&mpc, pnt + 3, sizeof(struct capability_mp_data));
|
||||||
@ -3180,7 +3182,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
|||||||
peer, capability,
|
peer, capability,
|
||||||
iana_afi2str(pkt_afi),
|
iana_afi2str(pkt_afi),
|
||||||
iana_safi2str(pkt_safi));
|
iana_safi2str(pkt_safi));
|
||||||
continue;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Address family check. */
|
/* Address family check. */
|
||||||
@ -3207,7 +3209,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
|||||||
if (peer_active_nego(peer))
|
if (peer_active_nego(peer))
|
||||||
bgp_clear_route(peer, afi, safi);
|
bgp_clear_route(peer, afi, safi);
|
||||||
else
|
else
|
||||||
return BGP_Stop;
|
goto done;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CAPABILITY_CODE_RESTART:
|
case CAPABILITY_CODE_RESTART:
|
||||||
@ -3217,7 +3219,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
|||||||
bgp_notify_send(peer->connection,
|
bgp_notify_send(peer->connection,
|
||||||
BGP_NOTIFY_CEASE,
|
BGP_NOTIFY_CEASE,
|
||||||
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
||||||
return BGP_Stop;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
bgp_dynamic_capability_graceful_restart(pnt, action,
|
bgp_dynamic_capability_graceful_restart(pnt, action,
|
||||||
@ -3243,7 +3245,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
|||||||
bgp_notify_send(peer->connection,
|
bgp_notify_send(peer->connection,
|
||||||
BGP_NOTIFY_CEASE,
|
BGP_NOTIFY_CEASE,
|
||||||
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
|
||||||
return BGP_Stop;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t role;
|
uint8_t role;
|
||||||
@ -3265,6 +3267,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
pnt += hdr->length + 3;
|
pnt += hdr->length + 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user