]> git.puffer.fish Git - mirror/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:50 +0000 (08:43 +0000)
commitb350439609305e75619dc5104b5a809b1a31ee7f
treeb84e998be54b78d9672219ae303814f2ce2ca845
parent623f5f42a5a133130b1ea340bbcff108289c98e8
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