Date: Wed, 3 Jul 2019 00:35:15 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349631 - stable/11/sbin/dhclient Message-ID: <201907030035.x630ZFlX067551@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Wed Jul 3 00:35:14 2019 New Revision: 349631 URL: https://svnweb.freebsd.org/changeset/base/349631 Log: MFC r349438: Avoid a divide-by-zero when bad checksum counters overflow. Modified: stable/11/sbin/dhclient/packet.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/dhclient/packet.c ============================================================================== --- stable/11/sbin/dhclient/packet.c Wed Jul 3 00:32:42 2019 (r349630) +++ stable/11/sbin/dhclient/packet.c Wed Jul 3 00:35:14 2019 (r349631) @@ -181,7 +181,7 @@ decode_udp_ip_header(unsigned char *buf, int bufix, st ip_packets_seen++; if (wrapsum(checksum(buf + bufix, ip_len, 0)) != 0) { ip_packets_bad_checksum++; - if (ip_packets_seen > 4 && + 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", ip_packets_bad_checksum, ip_packets_seen); @@ -233,7 +233,7 @@ decode_udp_ip_header(unsigned char *buf, int bufix, st udp_packets_seen++; if (usum && usum != sum) { udp_packets_bad_checksum++; - if (udp_packets_seen > 4 && + 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", udp_packets_bad_checksum, udp_packets_seen);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907030035.x630ZFlX067551>