]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Do not compare attr again. 8038/head
authorzyxwvu Shi <i@shiyc.cn>
Mon, 8 Feb 2021 12:09:02 +0000 (20:09 +0800)
committerzyxwvu Shi <i@shiyc.cn>
Mon, 8 Feb 2021 12:09:02 +0000 (20:09 +0800)
`same_attr` has been computed and `hook_call(bgp_process)` (calling
BMP module) would not change it. We could reuse the value to filter
same attribute updates, avoiding an extra comparison.

Signed-off-by: zyxwvu Shi <i@shiyc.cn>
bgpd/bgp_route.c

index 0ac9a42dc5172b9493aaeb7bb14b89330f532d5f..7f05dcc167f5f36002e09a2c079bae4e958e4d56 100644 (file)
@@ -3799,7 +3799,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
 
                /* Same attribute comes in. */
                if (!CHECK_FLAG(pi->flags, BGP_PATH_REMOVED)
-                   && attrhash_cmp(pi->attr, attr_new)
+                   && same_attr
                    && (!has_valid_label
                        || memcmp(&(bgp_path_info_extra_get(pi))->label, label,
                                  num_labels * sizeof(mpls_label_t))