From: anlan_cs Date: Fri, 12 Apr 2024 13:57:30 +0000 (+0800) Subject: bpgd: adjust return value for the same command X-Git-Tag: base_10.1~190^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1a8725b11fd84f875577f2066b4d6cccf4191933;p=matthieu%2Ffrr.git bpgd: adjust return value for the same command The same command should be accepted, it is an empty operation. Take `neighbor graceful-restart-helper` as an example: Before: ``` anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper Graceful restart configuration changed, reset this peer to take effect anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper Graceful restart configuration changed, reset this peer to take effect % The Graceful Restart command used is not valid at this moment. anlan(config-router)# ``` After: ``` anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper Graceful restart configuration changed, reset this peer to take effect anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper Graceful restart configuration changed, reset this peer to take effect anlan(config-router)# ``` Signed-off-by: anlan_cs --- diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index d98df754ef..33da70fb9b 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1377,7 +1377,7 @@ int bgp_global_gr_init(struct bgp *bgp) /*GLOBAL_GR_cmd */ /*no_Global_GR_cmd*/ GLOBAL_GR, GLOBAL_INVALID, /*GLOBAL_DISABLE_cmd*//*no_Global_Disable_cmd*/ - GLOBAL_INVALID, GLOBAL_HELPER + GLOBAL_DISABLE, GLOBAL_HELPER }, /* GLOBAL_INVALID Mode */ { @@ -1411,13 +1411,13 @@ int bgp_peer_gr_init(struct peer *peer) /* Event-> */ /* PEER_DISABLE_CMD */ /* NO_PEER_DISABLE_CMD */ {PEER_DISABLE, bgp_peer_gr_action }, {PEER_INVALID, NULL }, /* Event-> */ /* PEER_HELPER_cmd */ /* NO_PEER_HELPER_CMD */ - { PEER_INVALID, NULL }, {PEER_GLOBAL_INHERIT, + { PEER_HELPER, NULL }, {PEER_GLOBAL_INHERIT, bgp_peer_gr_action } }, { /* PEER_GR Mode */ /* Event-> */ /* PEER_GR_CMD */ /* NO_PEER_GR_CMD */ - { PEER_INVALID, NULL }, { PEER_GLOBAL_INHERIT, + { PEER_GR, NULL }, { PEER_GLOBAL_INHERIT, bgp_peer_gr_action }, /* Event-> */ /* PEER_DISABLE_CMD */ /* NO_PEER_DISABLE_CMD */ {PEER_DISABLE, bgp_peer_gr_action }, { PEER_INVALID, NULL }, @@ -1429,7 +1429,7 @@ int bgp_peer_gr_init(struct peer *peer) /* Event-> */ /* PEER_GR_CMD */ /* NO_PEER_GR_CMD */ { PEER_GR, bgp_peer_gr_action }, { PEER_INVALID, NULL }, /* Event-> */ /* PEER_DISABLE_CMD */ /* NO_PEER_DISABLE_CMD */ - { PEER_INVALID, NULL }, { PEER_GLOBAL_INHERIT, + { PEER_DISABLE, NULL }, { PEER_GLOBAL_INHERIT, bgp_peer_gr_action }, /* Event-> */ /* PEER_HELPER_cmd */ /* NO_PEER_HELPER_CMD */ { PEER_HELPER, bgp_peer_gr_action }, { PEER_INVALID, NULL }