Skip to content

Commit

Permalink
bpgd: adjust return value for the same command
Browse files Browse the repository at this point in the history
The same command should be accepted, it is an empty operation.  Take
`neighbor <X> 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 <[email protected]>
  • Loading branch information
anlancs committed Apr 13, 2024
1 parent b6e6656 commit 1a8725b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
{
Expand Down Expand Up @@ -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 },
Expand All @@ -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 }
Expand Down

0 comments on commit 1a8725b

Please sign in to comment.