]> 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)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 11 Feb 2025 08:47:15 +0000 (09:47 +0100)
commitc0e7fac1f57b05968d9e3319b88cccf38b5f64b0
tree1757a6c78f306177f7b373e565d485ab405d5bc9
parent00fd2e65517aca600ae8521095a7a1a42d103ce7
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