From owner-svn-src-all@freebsd.org Tue Sep 22 22:18:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B68A07D43; Tue, 22 Sep 2015 22:18:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8125E1318; Tue, 22 Sep 2015 22:18:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8MMIbi0070500; Tue, 22 Sep 2015 22:18:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8MMIbQd070499; Tue, 22 Sep 2015 22:18:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201509222218.t8MMIbQd070499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 22 Sep 2015 22:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288134 - in stable: 10/sbin/ipfw 9/sbin/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 22:18:37 -0000 Author: dim Date: Tue Sep 22 22:18:36 2015 New Revision: 288134 URL: https://svnweb.freebsd.org/changeset/base/288134 Log: MFC r286702: In ipfw2, avoid left-shifting negative integers, which is undefined. While here, make some other arguments to htonl(3) unsigned too. Modified: stable/9/sbin/ipfw/ipfw2.c Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/ipfw/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/ipfw/ipfw2.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sbin/ipfw/ipfw2.c ============================================================================== --- stable/9/sbin/ipfw/ipfw2.c Tue Sep 22 22:07:42 2015 (r288133) +++ stable/9/sbin/ipfw/ipfw2.c Tue Sep 22 22:18:36 2015 (r288134) @@ -2267,14 +2267,14 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int case '/': masklen = atoi(p); if (masklen == 0) - d[1] = htonl(0); /* mask */ + d[1] = htonl(0U); /* mask */ else if (masklen > 32) errx(EX_DATAERR, "bad width ``%s''", p); else - d[1] = htonl(~0 << (32 - masklen)); + d[1] = htonl(~0U << (32 - masklen)); break; case '{': /* no mask, assume /24 and put back the '{' */ - d[1] = htonl(~0 << (32 - 24)); + d[1] = htonl(~0U << (32 - 24)); *(--p) = md; break; @@ -2283,7 +2283,7 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int /* FALLTHROUGH */ case 0: /* initialization value */ default: - d[1] = htonl(~0); /* force /32 */ + d[1] = htonl(~0U); /* force /32 */ break; } d[0] &= d[1]; /* mask base address with mask */