Commit f390cda
bgpd:[GR] fix crash in print_bgp_vrfs json
When BGP is in warm boot and `show bgp vrfs json` is executed more than
once, bgpd crashes in print_bgp_vrfs. This is happening because of
JSON object is being added multiple times to the JSON array with out
allocating everytime in the for loop and when json is freed, it causes
the crash.
NOTE: This commit needs to be integrated with original commit 4af3b55
Ticket: #3861755
Testing:
Before the fix:
switch# show bgp vrfs json
Warning: connecting to bgpd...success!
{
.. <snippet>
}
switch# show bgp vrfs json
Warning: closing connection to bgpd because of an I/O error!
Warning: connecting to bgpd...failed!
After the fix:
BGP no longer crashes on `show bgp vrfs json` command and it works as
expected.
switch# show bgp vrfs json
{
"vrfs":{
.. <snippet>
}
switch# show bgp vrfs json
{
"vrfs":{
.. <snippet>
}
switch# show bgp vrfs json
{
"vrfs":{
.. <snippet>
}
switch# show bgp vrfs json
{
"vrfs":{
.. <snippet>
}
Signed-off-by: Karthikeya Venkat Muppalla <kmuppalla@nvidia.com>
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>1 parent ef0460b commit f390cda
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11227 | 11227 | | |
11228 | 11228 | | |
11229 | 11229 | | |
11230 | | - | |
11231 | 11230 | | |
11232 | 11231 | | |
11233 | 11232 | | |
11234 | 11233 | | |
| 11234 | + | |
11235 | 11235 | | |
11236 | 11236 | | |
11237 | 11237 | | |
| |||
0 commit comments