summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2014-08-18 20:58:57 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2014-08-18 20:58:57 +0000
commitf3c4d8b5b18ac06d389f84bd73a4018860a1425b (patch)
treea7e08ac43593bf153c1370f076222864aa8ac41a /usr.sbin/dhcpd
parent74198957ca2c5bf4ca8b54aa98aee84bf9746de2 (diff)
Variables to count seen packets should be unsigned.
ok krw@
Diffstat (limited to 'usr.sbin/dhcpd')
-rw-r--r--usr.sbin/dhcpd/packet.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/dhcpd/packet.c b/usr.sbin/dhcpd/packet.c
index 24520fce8ec..9a7b3226369 100644
--- a/usr.sbin/dhcpd/packet.c
+++ b/usr.sbin/dhcpd/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.7 2014/07/26 07:48:49 tobias Exp $ */
+/* $OpenBSD: packet.c,v 1.8 2014/08/18 20:58:56 tobias Exp $ */
/* Packet assembly code, originally contributed by Archie Cobbs. */
@@ -165,12 +165,12 @@ decode_udp_ip_header(struct interface_info *interface, unsigned char *buf,
unsigned char *data;
u_int32_t ip_len = (buf[bufix] & 0xf) << 2;
u_int32_t sum, usum;
- static int ip_packets_seen;
- static int ip_packets_bad_checksum;
- static int udp_packets_seen;
- static int udp_packets_bad_checksum;
- static int udp_packets_length_checked;
- static int udp_packets_length_overflow;
+ static unsigned int ip_packets_seen;
+ static unsigned int ip_packets_bad_checksum;
+ static unsigned int udp_packets_seen;
+ static unsigned int udp_packets_bad_checksum;
+ static unsigned int udp_packets_length_checked;
+ static unsigned int udp_packets_length_overflow;
int len;
ip = (struct ip *)(buf + bufix);
@@ -182,7 +182,7 @@ decode_udp_ip_header(struct interface_info *interface, unsigned char *buf,
ip_packets_bad_checksum++;
if (ip_packets_seen > 4 && ip_packets_bad_checksum != 0 &&
(ip_packets_seen / ip_packets_bad_checksum) < 2) {
- note("%d bad IP checksums seen in %d packets",
+ note("%u bad IP checksums seen in %u packets",
ip_packets_bad_checksum, ip_packets_seen);
ip_packets_seen = ip_packets_bad_checksum = 0;
}
@@ -209,7 +209,7 @@ decode_udp_ip_header(struct interface_info *interface, unsigned char *buf,
udp_packets_length_overflow != 0 &&
(udp_packets_length_checked /
udp_packets_length_overflow) < 2) {
- note("%d udp packets in %d too long - dropped",
+ note("%u udp packets in %u too long - dropped",
udp_packets_length_overflow,
udp_packets_length_checked);
udp_packets_length_overflow =
@@ -233,7 +233,7 @@ decode_udp_ip_header(struct interface_info *interface, unsigned char *buf,
udp_packets_bad_checksum++;
if (udp_packets_seen > 4 && udp_packets_bad_checksum != 0 &&
(udp_packets_seen / udp_packets_bad_checksum) < 2) {
- note("%d bad udp checksums in %d packets",
+ note("%u bad udp checksums in %u packets",
udp_packets_bad_checksum, udp_packets_seen);
udp_packets_seen = udp_packets_bad_checksum = 0;
}