summaryrefslogtreecommitdiff
path: root/lib/module.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2025-03-14 14:50:59 -0400
committerDonald Sharp <sharpd@nvidia.com>2025-03-14 14:50:59 -0400
commitc9655e289367ef691ac616f27733cfc808c875e1 (patch)
treebbd1e26a4b3fe68ac4a2aecbf4a56a063ffc8d66 /lib/module.c
parent7945af02000541ea6c1dc1ee0321cb5380768baf (diff)
bgpd: Remove unnecessary stream_new/stream_copies in bgp_open_make
The call into bgp_open_capability can return that it wrote more than BGP_OPEN_NON_EXT_OPT_LEN bytes, in that case the open part needs to be written again with ext_opt_params set to true to allow extended parameters to be written thus keeping the len < 255 bytes. The code to do this was first creating a new stream and then copying into it the stream, trying to call bgp_open_capability() and if it succeeded recopying the tmp stream back onto the original. Let's change this around such that we save the current spot in the stream of where we are writing and if the change does not work reset the pointer and try again with the correct parameter. This removes the stream and multiple copies and eventual free of the temporary stream. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/module.c')
0 files changed, 0 insertions, 0 deletions