'int' -> 'unsigned int' (and visa versa) where obvious.
Steal a couple of 'unsigned' -> u_int32_t from reyk@'s dhcrelay
tweaks.
No intentional functional change.
-/* $OpenBSD: clparse.c,v 1.109 2017/04/04 13:01:20 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.110 2017/04/08 20:16:04 krw Exp $ */
/* Parser for dhclient config and lease files. */
int parse_X(FILE *, u_int8_t *, int);
int parse_option_list(FILE *, u_int8_t *, size_t);
void parse_interface_declaration(FILE *, struct interface_info *);
-void parse_client_lease_statement(FILE *, int, struct interface_info *);
+void parse_client_lease_statement(FILE *, unsigned int,
+ struct interface_info *);
void parse_client_lease_declaration(FILE *, struct client_lease *,
struct interface_info *);
int parse_option_decl(FILE *, struct option_data *);
int
parse_option_list(FILE *cfile, u_int8_t *list, size_t sz)
{
- int ix, i, j;
- int token;
- char *val;
+ unsigned int ix, j;
+ int i;
+ int token;
+ char *val;
memset(list, DHO_PAD, sz);
ix = 0;
* client-lease-declarations client-lease-declaration
*/
void
-parse_client_lease_statement(FILE *cfile, int is_static,
+parse_client_lease_statement(FILE *cfile, unsigned int is_static,
struct interface_info *ifi)
{
struct client_state *client = ifi->client;
struct interface_info *ifi)
{
char *val;
- int len, token;
+ unsigned int len;
+ int token;
token = next_token(&val, cfile);
u_int8_t buf[4];
u_int8_t cidr[5];
u_int8_t hunkbuf[1024];
- int hunkix = 0;
+ unsigned int hunkix = 0;
char *fmt;
struct in_addr ip_addr;
u_int8_t *dp;
-/* $OpenBSD: conflex.c,v 1.36 2017/04/03 18:23:36 krw Exp $ */
+/* $OpenBSD: conflex.c,v 1.37 2017/04/08 20:16:04 krw Exp $ */
/* Lexical scanner for dhclient config file. */
static int
read_num_or_name(int c, FILE *cfile)
{
- int i, rv, xdigits;
+ unsigned int i, xdigits;
+ int rv;
xdigits = isxdigit(c) ? 1 : 0;
-/* $OpenBSD: dhclient.c,v 1.409 2017/04/08 17:00:10 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.410 2017/04/08 20:16:04 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
{
struct ifgroupreq ifgr;
struct ifg_req *ifg;
- int s, len;
+ unsigned int len;
+ int s;
if (strcmp(arg, "egress") == 0) {
s = socket(AF_INET, SOCK_DGRAM, 0);
add_classless_static_routes(struct option_data *opt, struct in_addr iface)
{
struct in_addr dest, netmask, gateway;
- int bits, bytes, i;
+ unsigned int i, bits, bytes;
i = 0;
while (i < opt->len) {
-/* $OpenBSD: dhcpd.h,v 1.168 2017/04/08 18:54:52 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.169 2017/04/08 20:16:04 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
extern int warnings_occurred;
void skip_to_semi(FILE *);
int parse_semi(FILE *);
-char *parse_string(FILE *, int *);
+char *parse_string(FILE *, unsigned int *);
int parse_ip_addr(FILE *, struct in_addr *);
int parse_cidr(FILE *, unsigned char *);
void parse_ethernet(FILE *, struct ether_addr *);
void assemble_eh_header(struct interface_info *, struct ether_header *);
ssize_t decode_hw_header(unsigned char *, int, struct ether_addr *);
ssize_t decode_udp_ip_header(unsigned char *, int, struct sockaddr_in *,
- int);
-u_int32_t checksum(unsigned char *, unsigned, u_int32_t);
+ u_int32_t);
+u_int32_t checksum(unsigned char *, u_int32_t, u_int32_t);
u_int32_t wrapsum(u_int32_t);
/* clparse.c */
-/* $OpenBSD: kroute.c,v 1.86 2017/04/05 18:22:31 krw Exp $ */
+/* $OpenBSD: kroute.c,v 1.87 2017/04/08 20:16:04 krw Exp $ */
/*
* Copyright 2012 Kenneth R Westerback <krw@openbsd.org>
struct sockaddr_rtlabel *sa_rl;
pid_t pid;
ssize_t len;
- u_int32_t seq;
- int s, rslt, iovcnt = 0;
+ int s, seq, rslt, iovcnt = 0;
rslt = 0;
-/* $OpenBSD: options.c,v 1.86 2017/04/08 18:54:52 krw Exp $ */
+/* $OpenBSD: options.c,v 1.87 2017/04/08 20:16:04 krw Exp $ */
/* DHCP options parsing and reassembly. */
static char string[8196];
char bitsbuf[5]; /* to hold "/nn " */
struct in_addr net, gateway;
- int bits, bytes, rslt;
+ unsigned int bytes;
+ int bits, rslt;
memset(string, 0, sizeof(string));
expand_search_domain_name(unsigned char *src, size_t srclen, int *offset,
unsigned char *domain_search)
{
- int domain_name_len, i, label_len, pointer, pointed_len;
+ unsigned int i;
+ int domain_name_len, label_len, pointer, pointed_len;
char *cursor;
cursor = domain_search + strlen(domain_search);
pretty_print_domain_search(unsigned char *src, size_t srclen)
{
static char domain_search[DHCP_DOMAIN_SEARCH_LEN];
- int offset, len, expanded_len, domains;
+ unsigned int offset;
+ int len, expanded_len, domains;
unsigned char *cursor;
memset(domain_search, 0, sizeof(domain_search));
-/* $OpenBSD: packet.c,v 1.33 2017/03/08 14:19:00 krw Exp $ */
+/* $OpenBSD: packet.c,v 1.34 2017/04/08 20:16:04 krw Exp $ */
/* Packet assembly code, originally contributed by Archie Cobbs. */
#include "log.h"
u_int32_t
-checksum(unsigned char *buf, unsigned nbytes, u_int32_t sum)
+checksum(unsigned char *buf, u_int32_t nbytes, u_int32_t sum)
{
- int i;
+ unsigned int i;
/* Checksum all the pairs of bytes first. */
for (i = 0; i < (nbytes & ~1U); i += 2) {
ssize_t
decode_udp_ip_header(unsigned char *buf, int bufix, struct sockaddr_in *from,
- int buflen)
+ u_int32_t buflen)
{
struct ip *ip;
struct udphdr *udp;
-/* $OpenBSD: parse.c,v 1.48 2017/04/03 19:59:39 krw Exp $ */
+/* $OpenBSD: parse.c,v 1.49 2017/04/08 20:16:04 krw Exp $ */
/* Common parser code for dhcpd and dhclient. */
}
char *
-parse_string(FILE *cfile, int *len)
+parse_string(FILE *cfile, unsigned int *len)
{
static char unvisbuf[1500];
char *val, *s;
parse_warn(char *msg)
{
static char spaces[81];
- int i;
+ unsigned int i;
log_warnx("%s line %d: %s", tlname, lexline, msg);
log_warnx("%s", token_line);