Skip to content

Commit 2a387ba

Browse files
committed
upstream: Replace all remaining instances of u_intXX_t types with the
C99 equivalent uintXX_t types. ok djm@ OpenBSD-Commit-ID: d9b81151266adb129574ce268af49f14ac23e65b
1 parent bb781f0 commit 2a387ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+485
-485
lines changed

addr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: addr.c,v 1.9 2024/10/18 04:30:09 djm Exp $ */
1+
/* $OpenBSD: addr.c,v 1.10 2026/03/03 09:57:25 dtucker Exp $ */
22

33
/*
44
* Copyright (c) 2004-2008 Damien Miller <djm@mindrot.org>
@@ -61,7 +61,7 @@ masklen_valid(int af, u_int masklen)
6161

6262
static int
6363
addr_xaddr_to_sa(const struct xaddr *xa, struct sockaddr *sa, socklen_t *len,
64-
u_int16_t port)
64+
uint16_t port)
6565
{
6666
struct sockaddr_in *in4 = (struct sockaddr_in *)sa;
6767
struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)sa;

addr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ struct xaddr {
2727
union {
2828
struct in_addr v4;
2929
struct in6_addr v6;
30-
u_int8_t addr8[16];
31-
u_int16_t addr16[8];
32-
u_int32_t addr32[4];
30+
uint8_t addr8[16];
31+
uint16_t addr16[8];
32+
uint32_t addr32[4];
3333
} xa; /* 128-bit address */
34-
u_int32_t scope_id; /* iface scope id for v6 */
34+
uint32_t scope_id; /* iface scope id for v6 */
3535
#define v4 xa.v4
3636
#define v6 xa.v6
3737
#define addr8 xa.addr8

audit-bsm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extern void aug_save_egid(gid_t);
9090
extern void aug_save_pid(pid_t);
9191
extern void aug_save_asid(au_asid_t);
9292
extern void aug_save_tid(dev_t, unsigned int);
93-
extern void aug_save_tid_ex(dev_t, u_int32_t *, u_int32_t);
93+
extern void aug_save_tid_ex(dev_t, uint32_t *, uint32_t);
9494
extern int aug_save_me(void);
9595
extern int aug_save_namask(void);
9696
extern void aug_save_event(au_event_t);
@@ -129,10 +129,10 @@ static AuditInfoTermID ssh_bsm_tid;
129129
* getaudit_addr() is only present on IPv6 capable machines.
130130
*/
131131
#if defined(HAVE_AUG_GET_MACHINE) || !defined(HAVE_GETAUDIT_ADDR)
132-
extern int aug_get_machine(char *, u_int32_t *, u_int32_t *);
132+
extern int aug_get_machine(char *, uint32_t *, uint32_t *);
133133
#else
134134
static int
135-
aug_get_machine(char *host, u_int32_t *addr, u_int32_t *type)
135+
aug_get_machine(char *host, uint32_t *addr, uint32_t *type)
136136
{
137137
struct addrinfo *ai;
138138
struct sockaddr_in *in4;

auth2-chall.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: auth2-chall.c,v 1.59 2026/02/06 22:59:18 dtucker Exp $ */
1+
/* $OpenBSD: auth2-chall.c,v 1.60 2026/03/03 09:57:25 dtucker Exp $ */
22
/*
33
* Copyright (c) 2001 Markus Friedl. All rights reserved.
44
* Copyright (c) 2001 Per Allansson. All rights reserved.
@@ -51,7 +51,7 @@ extern ServerOptions options;
5151

5252
static int auth2_challenge_start(struct ssh *);
5353
static int send_userauth_info_request(struct ssh *);
54-
static int input_userauth_info_response(int, u_int32_t, struct ssh *);
54+
static int input_userauth_info_response(int, uint32_t, struct ssh *);
5555

5656
#ifdef BSD_AUTH
5757
extern KbdintDevice mm_bsdauth_device;
@@ -291,7 +291,7 @@ send_userauth_info_request(struct ssh *ssh)
291291
}
292292

293293
static int
294-
input_userauth_info_response(int type, u_int32_t seq, struct ssh *ssh)
294+
input_userauth_info_response(int type, uint32_t seq, struct ssh *ssh)
295295
{
296296
Authctxt *authctxt = ssh->authctxt;
297297
KbdintAuthctxt *kbdintctxt;

auth2-gss.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: auth2-gss.c,v 1.38 2026/02/08 15:28:01 dtucker Exp $ */
1+
/* $OpenBSD: auth2-gss.c,v 1.39 2026/03/03 09:57:25 dtucker Exp $ */
22

33
/*
44
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -53,10 +53,10 @@
5353
extern ServerOptions options;
5454
extern struct authmethod_cfg methodcfg_gssapi;
5555

56-
static int input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh);
57-
static int input_gssapi_mic(int type, u_int32_t plen, struct ssh *ssh);
58-
static int input_gssapi_exchange_complete(int type, u_int32_t plen, struct ssh *ssh);
59-
static int input_gssapi_errtok(int, u_int32_t, struct ssh *);
56+
static int input_gssapi_token(int type, uint32_t plen, struct ssh *ssh);
57+
static int input_gssapi_mic(int type, uint32_t plen, struct ssh *ssh);
58+
static int input_gssapi_exchange_complete(int type, uint32_t plen, struct ssh *ssh);
59+
static int input_gssapi_errtok(int, uint32_t, struct ssh *);
6060

6161
/*
6262
* We only support those mechanisms that we know about (ie ones that we know
@@ -143,7 +143,7 @@ userauth_gssapi(struct ssh *ssh, const char *method)
143143
}
144144

145145
static int
146-
input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh)
146+
input_gssapi_token(int type, uint32_t plen, struct ssh *ssh)
147147
{
148148
Authctxt *authctxt = ssh->authctxt;
149149
Gssctxt *gssctxt;
@@ -207,7 +207,7 @@ input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh)
207207
}
208208

209209
static int
210-
input_gssapi_errtok(int type, u_int32_t plen, struct ssh *ssh)
210+
input_gssapi_errtok(int type, uint32_t plen, struct ssh *ssh)
211211
{
212212
Authctxt *authctxt = ssh->authctxt;
213213
Gssctxt *gssctxt;
@@ -251,7 +251,7 @@ input_gssapi_errtok(int type, u_int32_t plen, struct ssh *ssh)
251251
*/
252252

253253
static int
254-
input_gssapi_exchange_complete(int type, u_int32_t plen, struct ssh *ssh)
254+
input_gssapi_exchange_complete(int type, uint32_t plen, struct ssh *ssh)
255255
{
256256
Authctxt *authctxt = ssh->authctxt;
257257
int r, authenticated;
@@ -279,7 +279,7 @@ input_gssapi_exchange_complete(int type, u_int32_t plen, struct ssh *ssh)
279279
}
280280

281281
static int
282-
input_gssapi_mic(int type, u_int32_t plen, struct ssh *ssh)
282+
input_gssapi_mic(int type, uint32_t plen, struct ssh *ssh)
283283
{
284284
Authctxt *authctxt = ssh->authctxt;
285285
Gssctxt *gssctxt;

auth2.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: auth2.c,v 1.172 2026/02/08 00:16:34 dtucker Exp $ */
1+
/* $OpenBSD: auth2.c,v 1.173 2026/03/03 09:57:25 dtucker Exp $ */
22
/*
33
* Copyright (c) 2000 Markus Friedl. All rights reserved.
44
*
@@ -88,8 +88,8 @@ Authmethod *authmethods[] = {
8888

8989
/* protocol */
9090

91-
static int input_service_request(int, u_int32_t, struct ssh *);
92-
static int input_userauth_request(int, u_int32_t, struct ssh *);
91+
static int input_service_request(int, uint32_t, struct ssh *);
92+
static int input_userauth_request(int, uint32_t, struct ssh *);
9393

9494
/* helper */
9595
static Authmethod *authmethod_byname(const char *);
@@ -181,7 +181,7 @@ do_authentication2(struct ssh *ssh)
181181
}
182182

183183
static int
184-
input_service_request(int type, u_int32_t seq, struct ssh *ssh)
184+
input_service_request(int type, uint32_t seq, struct ssh *ssh)
185185
{
186186
Authctxt *authctxt = ssh->authctxt;
187187
char *service = NULL;
@@ -266,7 +266,7 @@ ensure_minimum_time_since(double start, double seconds)
266266
}
267267

268268
static int
269-
input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
269+
input_userauth_request(int type, uint32_t seq, struct ssh *ssh)
270270
{
271271
Authctxt *authctxt = ssh->authctxt;
272272
Authmethod *m = NULL;

authfd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: authfd.c,v 1.138 2026/02/14 00:18:34 jsg Exp $ */
1+
/* $OpenBSD: authfd.c,v 1.139 2026/03/03 09:57:25 dtucker Exp $ */
22
/*
33
* Author: Tatu Ylonen <ylo@cs.hut.fi>
44
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -258,7 +258,7 @@ int
258258
ssh_fetch_identitylist(int sock, struct ssh_identitylist **idlp)
259259
{
260260
u_char type;
261-
u_int32_t num, i;
261+
uint32_t num, i;
262262
struct sshbuf *msg;
263263
struct ssh_identitylist *idl = NULL;
264264
int r;

canohost.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ipv64_normalise_mapped(struct sockaddr_storage *addr, socklen_t *len)
4040
struct sockaddr_in6 *a6 = (struct sockaddr_in6 *)addr;
4141
struct sockaddr_in *a4 = (struct sockaddr_in *)addr;
4242
struct in_addr inaddr;
43-
u_int16_t port;
43+
uint16_t port;
4444

4545
if (addr->ss_family != AF_INET6 ||
4646
!IN6_IS_ADDR_V4MAPPED(&a6->sin6_addr))

channels.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: channels.c,v 1.455 2026/02/14 00:18:34 jsg Exp $ */
1+
/* $OpenBSD: channels.c,v 1.456 2026/03/03 09:57:25 dtucker Exp $ */
22
/*
33
* Author: Tatu Ylonen <ylo@cs.hut.fi>
44
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -3361,7 +3361,7 @@ channel_proxy_downstream(struct ssh *ssh, Channel *downstream)
33613361
* replaces local (proxy) channel ID with downstream channel ID.
33623362
*/
33633363
int
3364-
channel_proxy_upstream(Channel *c, int type, u_int32_t seq, struct ssh *ssh)
3364+
channel_proxy_upstream(Channel *c, int type, uint32_t seq, struct ssh *ssh)
33653365
{
33663366
struct sshbuf *b = NULL;
33673367
Channel *downstream;
@@ -3444,7 +3444,7 @@ channel_proxy_upstream(Channel *c, int type, u_int32_t seq, struct ssh *ssh)
34443444
static int
34453445
channel_parse_id(struct ssh *ssh, const char *where, const char *what)
34463446
{
3447-
u_int32_t id;
3447+
uint32_t id;
34483448
int r;
34493449

34503450
if ((r = sshpkt_get_u32(ssh, &id)) != 0) {
@@ -3473,7 +3473,7 @@ channel_from_packet_id(struct ssh *ssh, const char *where, const char *what)
34733473
}
34743474

34753475
int
3476-
channel_input_data(int type, u_int32_t seq, struct ssh *ssh)
3476+
channel_input_data(int type, uint32_t seq, struct ssh *ssh)
34773477
{
34783478
const u_char *data;
34793479
size_t data_len, win_len;
@@ -3541,11 +3541,11 @@ channel_input_data(int type, u_int32_t seq, struct ssh *ssh)
35413541
}
35423542

35433543
int
3544-
channel_input_extended_data(int type, u_int32_t seq, struct ssh *ssh)
3544+
channel_input_extended_data(int type, uint32_t seq, struct ssh *ssh)
35453545
{
35463546
const u_char *data;
35473547
size_t data_len;
3548-
u_int32_t tcode;
3548+
uint32_t tcode;
35493549
Channel *c = channel_from_packet_id(ssh, __func__, "extended data");
35503550
int r;
35513551

@@ -3594,7 +3594,7 @@ channel_input_extended_data(int type, u_int32_t seq, struct ssh *ssh)
35943594
}
35953595

35963596
int
3597-
channel_input_ieof(int type, u_int32_t seq, struct ssh *ssh)
3597+
channel_input_ieof(int type, uint32_t seq, struct ssh *ssh)
35983598
{
35993599
Channel *c = channel_from_packet_id(ssh, __func__, "ieof");
36003600
int r;
@@ -3619,7 +3619,7 @@ channel_input_ieof(int type, u_int32_t seq, struct ssh *ssh)
36193619
}
36203620

36213621
int
3622-
channel_input_oclose(int type, u_int32_t seq, struct ssh *ssh)
3622+
channel_input_oclose(int type, uint32_t seq, struct ssh *ssh)
36233623
{
36243624
Channel *c = channel_from_packet_id(ssh, __func__, "oclose");
36253625
int r;
@@ -3635,10 +3635,10 @@ channel_input_oclose(int type, u_int32_t seq, struct ssh *ssh)
36353635
}
36363636

36373637
int
3638-
channel_input_open_confirmation(int type, u_int32_t seq, struct ssh *ssh)
3638+
channel_input_open_confirmation(int type, uint32_t seq, struct ssh *ssh)
36393639
{
36403640
Channel *c = channel_from_packet_id(ssh, __func__, "open confirmation");
3641-
u_int32_t remote_window, remote_maxpacket;
3641+
uint32_t remote_window, remote_maxpacket;
36423642
int r;
36433643

36443644
if (channel_proxy_upstream(c, type, seq, ssh))
@@ -3690,10 +3690,10 @@ reason2txt(int reason)
36903690
}
36913691

36923692
int
3693-
channel_input_open_failure(int type, u_int32_t seq, struct ssh *ssh)
3693+
channel_input_open_failure(int type, uint32_t seq, struct ssh *ssh)
36943694
{
36953695
Channel *c = channel_from_packet_id(ssh, __func__, "open failure");
3696-
u_int32_t reason;
3696+
uint32_t reason;
36973697
char *msg = NULL;
36983698
int r;
36993699

@@ -3727,11 +3727,11 @@ channel_input_open_failure(int type, u_int32_t seq, struct ssh *ssh)
37273727
}
37283728

37293729
int
3730-
channel_input_window_adjust(int type, u_int32_t seq, struct ssh *ssh)
3730+
channel_input_window_adjust(int type, uint32_t seq, struct ssh *ssh)
37313731
{
37323732
int id = channel_parse_id(ssh, __func__, "window adjust");
37333733
Channel *c;
3734-
u_int32_t adjust;
3734+
uint32_t adjust;
37353735
u_int new_rwin;
37363736
int r;
37373737

@@ -3757,7 +3757,7 @@ channel_input_window_adjust(int type, u_int32_t seq, struct ssh *ssh)
37573757
}
37583758

37593759
int
3760-
channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh)
3760+
channel_input_status_confirm(int type, uint32_t seq, struct ssh *ssh)
37613761
{
37623762
int id = channel_parse_id(ssh, __func__, "status confirm");
37633763
Channel *c;

channels.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: channels.h,v 1.162 2025/10/07 08:02:32 djm Exp $ */
1+
/* $OpenBSD: channels.h,v 1.163 2026/03/03 09:57:25 dtucker Exp $ */
22

33
/*
44
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -325,18 +325,18 @@ void channel_clear_timeouts(struct ssh *);
325325
/* mux proxy support */
326326

327327
int channel_proxy_downstream(struct ssh *, Channel *mc);
328-
int channel_proxy_upstream(Channel *, int, u_int32_t, struct ssh *);
328+
int channel_proxy_upstream(Channel *, int, uint32_t, struct ssh *);
329329

330330
/* protocol handler */
331331

332-
int channel_input_data(int, u_int32_t, struct ssh *);
333-
int channel_input_extended_data(int, u_int32_t, struct ssh *);
334-
int channel_input_ieof(int, u_int32_t, struct ssh *);
335-
int channel_input_oclose(int, u_int32_t, struct ssh *);
336-
int channel_input_open_confirmation(int, u_int32_t, struct ssh *);
337-
int channel_input_open_failure(int, u_int32_t, struct ssh *);
338-
int channel_input_window_adjust(int, u_int32_t, struct ssh *);
339-
int channel_input_status_confirm(int, u_int32_t, struct ssh *);
332+
int channel_input_data(int, uint32_t, struct ssh *);
333+
int channel_input_extended_data(int, uint32_t, struct ssh *);
334+
int channel_input_ieof(int, uint32_t, struct ssh *);
335+
int channel_input_oclose(int, uint32_t, struct ssh *);
336+
int channel_input_open_confirmation(int, uint32_t, struct ssh *);
337+
int channel_input_open_failure(int, uint32_t, struct ssh *);
338+
int channel_input_window_adjust(int, uint32_t, struct ssh *);
339+
int channel_input_status_confirm(int, uint32_t, struct ssh *);
340340

341341
/* file descriptor handling (read/write) */
342342
struct pollfd;

0 commit comments

Comments
 (0)