summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_packet.c
diff options
context:
space:
mode:
authorsri-mohan1 <sri.mohan@samsung.com>2024-10-09 10:49:55 +0200
committersri-mohan1 <sri.mohan@samsung.com>2024-10-10 19:53:20 +0200
commitc853c8d13baeff86e99b3c5217fd32e09db10f80 (patch)
treed2e1c713ff08edc64e3f5b17dae1958090b7ee4b /bgpd/bgp_packet.c
parentbuild: FRR 10.3 development version (diff)
downloadfrr-c853c8d13baeff86e99b3c5217fd32e09db10f80.tar.xz
frr-c853c8d13baeff86e99b3c5217fd32e09db10f80.zip
bgpd: changes for code maintainability
these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_packet.c64
1 files changed, 27 insertions, 37 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 62be7ffbf..646ab1d95 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -2935,35 +2935,31 @@ static int bgp_route_refresh_receive(struct peer_connection *connection,
if (bgp_debug_neighbor_events(peer)) {
char buf[INET6_BUFSIZ];
- zlog_debug(
- "%pBP rcvd %s %s seq %u %s/%d ge %d le %d%s",
- peer,
- (common & ORF_COMMON_PART_REMOVE
- ? "Remove"
- : "Add"),
- (common & ORF_COMMON_PART_DENY
- ? "deny"
- : "permit"),
- orfp.seq,
- inet_ntop(
- orfp.p.family,
- &orfp.p.u.prefix,
- buf,
- INET6_BUFSIZ),
- orfp.p.prefixlen,
- orfp.ge, orfp.le,
- ok ? "" : " MALFORMED");
+ zlog_debug("%pBP rcvd %s %s seq %u %s/%d ge %d le %d%s",
+ peer,
+ (CHECK_FLAG(common, ORF_COMMON_PART_REMOVE)
+ ? "Remove"
+ : "Add"),
+ (CHECK_FLAG(common, ORF_COMMON_PART_DENY)
+ ? "deny"
+ : "permit"),
+ orfp.seq,
+ inet_ntop(orfp.p.family, &orfp.p.u.prefix,
+ buf, INET6_BUFSIZ),
+ orfp.p.prefixlen, orfp.ge, orfp.le,
+ ok ? "" : " MALFORMED");
}
if (ok)
- ret = prefix_bgp_orf_set(
- name, afi, &orfp,
- (common & ORF_COMMON_PART_DENY
- ? 0
- : 1),
- (common & ORF_COMMON_PART_REMOVE
- ? 0
- : 1));
+ ret = prefix_bgp_orf_set(name, afi, &orfp,
+ (CHECK_FLAG(common,
+ ORF_COMMON_PART_DENY)
+ ? 0
+ : 1),
+ (CHECK_FLAG(common,
+ ORF_COMMON_PART_REMOVE)
+ ? 0
+ : 1));
if (!ok || (ok && ret != CMD_SUCCESS)) {
zlog_info(
@@ -3190,17 +3186,11 @@ static void bgp_dynamic_capability_addpath(uint8_t *pnt, int action,
if (bgp_debug_neighbor_events(peer))
zlog_debug("%s OPEN has %s capability for afi/safi: %s/%s%s%s",
- peer->host,
- lookup_msg(capcode_str, hdr->code,
- NULL),
- iana_afi2str(pkt_afi),
- iana_safi2str(pkt_safi),
- (bac.flags & BGP_ADDPATH_RX)
- ? ", receive"
- : "",
- (bac.flags & BGP_ADDPATH_TX)
- ? ", transmit"
- : "");
+ peer->host, lookup_msg(capcode_str, hdr->code, NULL),
+ iana_afi2str(pkt_afi), iana_safi2str(pkt_safi),
+ CHECK_FLAG(bac.flags, BGP_ADDPATH_RX) ? ", receive" : "",
+ CHECK_FLAG(bac.flags, BGP_ADDPATH_TX) ? ", transmit"
+ : "");
if (bgp_map_afi_safi_iana2int(pkt_afi, pkt_safi, &afi,
&safi)) {