From d782e3ffa24832b05aec2871332a3a8523ab3e97 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 23 Feb 2023 23:02:35 +0200 Subject: [PATCH] bgpd: Convert missing uint32_t to uint64_t for for af_flags/flags It was hard to catch those unless using higher values than uint32_t, but already hit, it's time to fix completely. Signed-off-by: Donatas Abraitis --- bgpd/bgp_updgrp.c | 6 +++--- bgpd/bgp_vty.c | 6 +++--- bgpd/bgpd.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index a32cdb1ba4..277492157f 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -317,7 +317,7 @@ static unsigned int updgrp_hash_key_make(const void *p) const struct update_group *updgrp; const struct peer *peer; const struct bgp_filter *filter; - uint32_t flags; + uint64_t flags; uint32_t key; afi_t afi; safi_t safi; @@ -501,8 +501,8 @@ static bool updgrp_hash_cmp(const void *p1, const void *p2) const struct update_group *grp2; const struct peer *pe1; const struct peer *pe2; - uint32_t flags1; - uint32_t flags2; + uint64_t flags1; + uint64_t flags2; const struct bgp_filter *fl1; const struct bgp_filter *fl2; afi_t afi; diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 928a41e9ed..cf9a05b198 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -5671,7 +5671,7 @@ DEFPY(neighbor_capability_software_version, } static int peer_af_flag_modify_vty(struct vty *vty, const char *peer_str, - afi_t afi, safi_t safi, uint32_t flag, + afi_t afi, safi_t safi, uint64_t flag, int set) { int ret; @@ -5690,13 +5690,13 @@ static int peer_af_flag_modify_vty(struct vty *vty, const char *peer_str, } static int peer_af_flag_set_vty(struct vty *vty, const char *peer_str, - afi_t afi, safi_t safi, uint32_t flag) + afi_t afi, safi_t safi, uint64_t flag) { return peer_af_flag_modify_vty(vty, peer_str, afi, safi, flag, 1); } static int peer_af_flag_unset_vty(struct vty *vty, const char *peer_str, - afi_t afi, safi_t safi, uint32_t flag) + afi_t afi, safi_t safi, uint64_t flag) { return peer_af_flag_modify_vty(vty, peer_str, afi, safi, flag, 0); } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 26da5d3e26..f97004dc12 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -2726,7 +2726,7 @@ struct peer_group *peer_group_get(struct bgp *bgp, const char *name) static void peer_group2peer_config_copy(struct peer_group *group, struct peer *peer) { - uint32_t flags_tmp; + uint64_t flags_tmp; struct peer *conf; bool config_node = !!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE); @@ -4518,7 +4518,7 @@ static int peer_flag_action_set(const struct peer_flag_action *action_list, return found; } -static void peer_flag_modify_action(struct peer *peer, uint32_t flag) +static void peer_flag_modify_action(struct peer *peer, uint64_t flag) { if (flag == PEER_FLAG_SHUTDOWN) { if (CHECK_FLAG(peer->flags, flag)) { -- 2.39.5