]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Only set bgp_labels in bgp_update if we have num_labels
authorDonald Sharp <sharpd@nvidia.com>
Wed, 30 Oct 2024 15:14:56 +0000 (11:14 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 31 Oct 2024 14:35:00 +0000 (10:35 -0400)
commitd9fd4901f0295d65ffdebb189d92a7d24e7d5e6f
tree304d62c93f0e2cf392cf98a70b456c773ef07edf
parent852e6c327dcaea1b73a5f703646edb5685dac204
bgpd: Only set bgp_labels in bgp_update if we have num_labels

In the interest of speeding up code, there is no point in
attempting to see if a label is usable if the number of labels
passed in is 0.  Since that is a much much quicker test than
the bgp_is_valid_label() call, let's test that first.

Additionally, there is no point in walking the label[] array
passed in unless we are in the if statement, so move it inside.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_route.c