diff options
author | Donald Sharp <sharpd@nvidia.com> | 2021-11-11 15:39:52 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2021-11-11 15:39:52 +0100 |
commit | 7a8ce9d56dec3844031563c3c55bed8eb3b692d5 (patch) | |
tree | 540ad9555825587c56143bcfc1d1172e4977a00c /ldpd | |
parent | Merge pull request #10006 from chiragshah6/evpn_dev (diff) | |
download | frr-7a8ce9d56dec3844031563c3c55bed8eb3b692d5.tar.xz frr-7a8ce9d56dec3844031563c3c55bed8eb3b692d5.zip |
*: use compiler.h MIN/MAX macros instead of everyone having one
We had various forms of min/max macros across multiple daemons
all of which duplicated what we have in compiler.h. Convert
everyone to use the `correct` ones
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ldpd')
-rw-r--r-- | ldpd/hello.c | 4 | ||||
-rw-r--r-- | ldpd/init.c | 4 | ||||
-rw-r--r-- | ldpd/ldpe.h | 3 |
3 files changed, 4 insertions, 7 deletions
diff --git a/ldpd/hello.c b/ldpd/hello.c index 5aa14ed06..629fe46e7 100644 --- a/ldpd/hello.c +++ b/ldpd/hello.c @@ -415,13 +415,13 @@ recv_hello(struct in_addr lsr_id, struct ldp_msg *msg, int af, if (holdtime == 0) holdtime = LINK_DFLT_HOLDTIME; - adj->holdtime = min(if_get_hello_holdtime(ia), holdtime); + adj->holdtime = MIN(if_get_hello_holdtime(ia), holdtime); break; case HELLO_TARGETED: if (holdtime == 0) holdtime = TARGETED_DFLT_HOLDTIME; - adj->holdtime = min(tnbr_get_hello_holdtime(tnbr), holdtime); + adj->holdtime = MIN(tnbr_get_hello_holdtime(tnbr), holdtime); } if (adj->holdtime != INFINITE_HOLDTIME) adj_start_itimer(adj); diff --git a/ldpd/init.c b/ldpd/init.c index d394fb08e..0ee64c16f 100644 --- a/ldpd/init.c +++ b/ldpd/init.c @@ -197,7 +197,7 @@ recv_init(struct nbr *nbr, char *buf, uint16_t len) len -= tlv_len; } - nbr->keepalive = min(nbr_get_keepalive(nbr->af, nbr->id), + nbr->keepalive = MIN(nbr_get_keepalive(nbr->af, nbr->id), ntohs(sess.keepalive_time)); max_pdu_len = ntohs(sess.max_pdu_len); @@ -208,7 +208,7 @@ recv_init(struct nbr *nbr, char *buf, uint16_t len) */ if (max_pdu_len <= 255) max_pdu_len = LDP_MAX_LEN; - nbr->max_pdu_len = min(max_pdu_len, LDP_MAX_LEN); + nbr->max_pdu_len = MIN(max_pdu_len, LDP_MAX_LEN); nbr_fsm(nbr, NBR_EVT_INIT_RCVD); diff --git a/ldpd/ldpe.h b/ldpd/ldpe.h index 880722424..0f650a86d 100644 --- a/ldpd/ldpe.h +++ b/ldpd/ldpe.h @@ -30,9 +30,6 @@ #include "ldpd.h" #include "lib/ldp_sync.h" -#define min(x,y) ((x) <= (y) ? (x) : (y)) -#define max(x,y) ((x) > (y) ? (x) : (y)) - /* forward declarations */ TAILQ_HEAD(mapping_head, mapping_entry); |