]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: don't reuse nexthop variable in loop/switch
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 22 Jan 2025 10:13:21 +0000 (11:13 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 11 Feb 2025 08:43:51 +0000 (08:43 +0000)
commit495b2b0265a4e386ceded5ef5b0d12b08411fbd3
tree95896a247391a3f154caddd382a00ef40ae1400f
parent0245b8ed9246a588a761fbc9388281e0f63d84a6
bgpd: don't reuse nexthop variable in loop/switch

While the loop is currently exited in all cases after using nexthop, it
is a footgun to have "nh" around to be reused in another iteration of
the loop.  This would leave nexthop with partial data from the previous
use.  Make it local where needed instead.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit ce7f5b21221f0b3557d1f4a40793230d8bc4cf02)
bgpd/bgp_pbr.c