]> 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)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 29 Jan 2025 15:48:37 +0000 (16:48 +0100)
commitce7f5b21221f0b3557d1f4a40793230d8bc4cf02
tree1b664f2678243f09e2fd1e8f1bc0578be3b1de72
parentf849511c47783b1554918dd0e8ccdd63e769ef61
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>
bgpd/bgp_pbr.c