1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 15:23:33 +02:00

bgpd: continue converting loop counters from uint8_t to u_int

ok claudio
This commit is contained in:
tb
2026-05-08 12:03:50 +00:00
parent 2d98a1950a
commit 4ef7690b02
8 changed files with 31 additions and 27 deletions
+8 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: parse.y,v 1.491 2026/05/08 05:27:25 tb Exp $ */
/* $OpenBSD: parse.y,v 1.492 2026/05/08 12:03:50 tb Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1720,7 +1720,7 @@ neighbor : { curpeer = new_peer(); }
}
}
peeropts_h {
uint8_t aid;
u_int aid;
if (curpeer_filter[0] != NULL)
TAILQ_INSERT_TAIL(peerfilter_l,
@@ -1945,10 +1945,11 @@ peeropts : REMOTEAS as4number {
curpeer->conf.staletime = $2;
}
| ANNOUNCE af safi enforce {
uint8_t aid, safi;
uint16_t afi;
if ($3 == SAFI_NONE) {
u_int aid;
uint8_t safi;
uint16_t afi;
for (aid = AID_MIN; aid < AID_MAX; aid++) {
if (aid2afi(aid, &afi, &safi) == -1 ||
afi != $2)
@@ -1956,6 +1957,8 @@ peeropts : REMOTEAS as4number {
curpeer->conf.capabilities.mp[aid] = -1;
}
} else {
uint8_t aid;
if (afi2aid($2, $3, &aid) == -1) {
yyerror("unknown AFI/SAFI pair");
YYERROR;
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: printconf.c,v 1.185 2026/03/02 09:51:48 claudio Exp $ */
/* $OpenBSD: printconf.c,v 1.186 2026/05/08 12:03:50 tb Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -918,7 +918,7 @@ print_addpath_mode(enum addpath_mode mode)
void
print_announce(struct peer_config *p, const char *c)
{
uint8_t aid;
u_int aid;
int match = 0;
for (aid = AID_MIN; aid < AID_MAX; aid++)
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: rde.c,v 1.697 2026/05/07 20:35:19 claudio Exp $ */
/* $OpenBSD: rde.c,v 1.698 2026/05/08 12:03:50 tb Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -168,7 +168,7 @@ rde_main(int debug, int verbose)
void *newp;
u_int pfd_elms = 0, i, j;
int timeout;
uint8_t aid;
u_int aid;
log_init(debug, LOG_DAEMON);
log_setverbose(verbose);
@@ -468,7 +468,7 @@ rde_dispatch_imsg_session(struct imsgbuf *imsgbuf)
uint32_t peerid;
pid_t pid;
int verbose;
uint8_t aid;
u_int aid;
while (imsgbuf) {
if ((n = imsg_get(imsgbuf, &imsg)) == -1)
@@ -3636,7 +3636,7 @@ int
rde_update_queue_pending(void)
{
struct rde_peer *peer;
uint8_t aid;
u_int aid;
if (ibuf_se && imsgbuf_queuelen(ibuf_se) >= SESS_MSG_HIGH_MARK)
return 0;
@@ -4209,7 +4209,7 @@ rde_softreconfig_in_done(void *arg, uint8_t dummy)
}
RB_FOREACH(peer, peer_tree, &peertable) {
uint8_t aid;
u_int aid;
if (peer->reconf_rib) {
/* dump the full table to neighbors that changed rib */
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: rde_adjout.c,v 1.17 2026/05/07 12:33:12 claudio Exp $ */
/* $OpenBSD: rde_adjout.c,v 1.18 2026/05/08 12:03:50 tb Exp $ */
/*
* Copyright (c) 2003, 2004, 2025 Claudio Jeker <claudio@openbsd.org>
@@ -861,7 +861,7 @@ adjout_peer_flush_pending(struct rde_peer *peer)
{
struct pend_attr *pa, *npa;
struct pend_prefix *pp, *npp;
uint8_t aid;
u_int aid;
for (aid = AID_MIN; aid < AID_MAX; aid++) {
TAILQ_FOREACH_SAFE(pp, &peer->withdraws[aid], entry, npp) {
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: rde_peer.c,v 1.71 2026/05/07 09:19:48 claudio Exp $ */
/* $OpenBSD: rde_peer.c,v 1.72 2026/05/08 12:03:50 tb Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
@@ -428,7 +428,7 @@ peer_flush_upcall(struct rib_entry *re, void *arg)
void
peer_up(struct rde_peer *peer, struct session_up *sup)
{
uint8_t i;
u_int i;
int force_sync = 1;
if (peer->state == PEER_ERR) {
@@ -568,7 +568,7 @@ peer_flush(struct rde_peer *peer, uint8_t aid, monotime_t staletime)
/* every route is gone so reset staletime */
if (aid == AID_UNSPEC) {
uint8_t i;
u_int i;
for (i = AID_MIN; i < AID_MAX; i++)
peer->staletime[i] = monotime_clear();
} else {
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: session.c,v 1.533 2026/05/07 17:59:15 claudio Exp $ */
/* $OpenBSD: session.c,v 1.534 2026/05/08 12:03:50 tb Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -1047,7 +1047,7 @@ session_handle_rrefresh(struct peer *peer, struct route_refresh *rr)
void
session_graceful_restart(struct peer *p)
{
uint8_t i;
u_int i;
u_int staletime = conf->staletime;
if (p->conf.staletime)
@@ -1087,7 +1087,7 @@ session_graceful_restart(struct peer *p)
void
session_graceful_stop(struct peer *p)
{
uint8_t i;
u_int i;
for (i = AID_MIN; i < AID_MAX; i++) {
/*
+5 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: session_bgp.c,v 1.8 2026/05/07 12:20:42 claudio Exp $ */
/* $OpenBSD: session_bgp.c,v 1.9 2026/05/08 12:03:50 tb Exp $ */
/*
* Copyright (c) 2004 - 2025 Claudio Jeker <claudio@openbsd.org>
@@ -182,7 +182,7 @@ session_open(struct peer *p)
{
struct ibuf *buf, *opb;
size_t len, optparamlen;
uint8_t i;
u_int i;
int errs = 0, extlen = 0;
int mpcapa = 0;
@@ -519,7 +519,7 @@ session_notification(struct peer *p, uint8_t errcode, uint8_t subcode,
int
session_neighbor_rrefresh(struct peer *p)
{
uint8_t i;
u_int i;
if (!(p->capa.neg.refresh || p->capa.neg.enhanced_rr))
return (-1);
@@ -1280,7 +1280,8 @@ static int
capa_neg_calc(struct peer *p)
{
struct ibuf *ebuf;
uint8_t i, hasmp = 0, capa_code, capa_len, capa_aid = 0;
u_int i;
uint8_t hasmp = 0, capa_code, capa_len, capa_aid = 0;
/* a capability is accepted only if both sides announced it */
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: util.c,v 1.100 2026/05/05 09:12:04 claudio Exp $ */
/* $OpenBSD: util.c,v 1.101 2026/05/08 12:03:50 tb Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -1140,7 +1140,7 @@ aid2afi(uint8_t aid, uint16_t *afi, uint8_t *safi)
int
afi2aid(uint16_t afi, uint8_t safi, uint8_t *aid)
{
uint8_t i;
u_int i;
for (i = AID_MIN; i < AID_MAX; i++)
if (aid_vals[i].afi == afi && aid_vals[i].safi == safi) {
@@ -1162,7 +1162,7 @@ aid2af(uint8_t aid)
int
af2aid(sa_family_t af, uint8_t safi, uint8_t *aid)
{
uint8_t i;
u_int i;
if (safi == 0) /* default to unicast subclass */
safi = SAFI_UNICAST;