diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-06-07 13:23:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-06-07 13:23:31 +0000 |
commit | 9368cd843ba12fa623b8d61081146439a555ee84 (patch) | |
tree | e45a3d6addae85cf9bde4846fc5a131b8c1eb2e4 /usr.bin/ssh | |
parent | 3268e23184a23dee269783cba7d665b8dfcdfab0 (diff) |
avoid shadowing issues which some compilers won't accept
ok djm
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/srclimit.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/ssh/srclimit.c b/usr.bin/ssh/srclimit.c index 2a8dffd7d66..ffea6a3973e 100644 --- a/usr.bin/ssh/srclimit.c +++ b/usr.bin/ssh/srclimit.c @@ -42,7 +42,7 @@ static char *penalty_exempt; static struct child_info { int id; struct xaddr addr; -} *child; +} *children; /* * Penalised addresses, active entries here prohibit connections until expired. @@ -112,9 +112,9 @@ srclimit_init(int max, int persource, int ipv4len, int ipv6len, max, persource, ipv4len, ipv6len); if (max <= 0) fatal("%s: invalid number of sockets: %d", __func__, max); - child = xcalloc(max_children, sizeof(*child)); + children = xcalloc(max_children, sizeof(*children)); for (i = 0; i < max_children; i++) - child[i].id = -1; + children[i].id = -1; RB_INIT(&penalties_by_addr); RB_INIT(&penalties_by_expiry); } @@ -140,10 +140,10 @@ srclimit_check_allow(int sock, int id) first_unused = max_children; /* Count matching entries and find first unused one. */ for (i = 0; i < max_children; i++) { - if (child[i].id == -1) { + if (children[i].id == -1) { if (i < first_unused) first_unused = i; - } else if (addr_cmp(&child[i].addr, &xb) == 0) { + } else if (addr_cmp(&children[i].addr, &xb) == 0) { count++; } } @@ -166,8 +166,8 @@ srclimit_check_allow(int sock, int id) return 0; /* Connection allowed, store masked address. */ - child[first_unused].id = id; - memcpy(&child[first_unused].addr, &xb, sizeof(xb)); + children[first_unused].id = id; + memcpy(&children[first_unused].addr, &xb, sizeof(xb)); return 1; } @@ -182,8 +182,8 @@ srclimit_done(int id) debug("%s: id %d", __func__, id); /* Clear corresponding state entry. */ for (i = 0; i < max_children; i++) { - if (child[i].id == id) { - child[i].id = -1; + if (children[i].id == id) { + children[i].id = -1; return; } } |