Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sending Cease/Hard Reset notification
Send Cease/Hard Reset notification for certain scenario when graceful restart + notification support (RFC8538) are enabled. In this implementation, we follow the suggestion of RFC8538 and map following notification subcodes to Hard Reset subcode. 1. BGP_ERROR_SUB_MAXIMUM_NUMBER_OF_PREFIXES_REACHED In this case, GoBGP is in the resource shortage and not working properly. Thus, the peer should stop forwarding packet immediately. 2. BGP_ERROR_SUB_ADMINISTRATIVE_SHUTDOWN This happens when the user uses DisablePeer API. This clearly indicates user's intention of shutting down the session. Thus, we should send Hard Reset. 3. BGP_ERROR_SUB_PEER_DECONFIGURED This happens whne the user uses DeletePeer API or StopBgp API or there's an ASN mismatch found in the Open phase. The former two cases, the user shows the intention to shutdown the session, so we should Hard Reset. The latter case is not so obvious, but I think it's ok to do Hard Reset because it is an unrecoverable error that cannot be solved without user's involvement. 4. Hard Reset This case currently doesn't exist, but obviously we should send Hard Reset when someone explicitly specifies it. The behavior for the remaining subcodes are unchanged. We may want to expose a knob to adjust the behavior of BGP_ERROR_SUB_ADMINISTRATIVE_RESET as suggested by RFC8538, but for this initial implementation, we kept it as is. Signed-off-by: Yutaro Hayakawa <[email protected]>
- Loading branch information