From owner-dev-commits-src-branches@freebsd.org Sun May 30 14:34:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 657DE656B17; Sun, 30 May 2021 14:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FtLXl28YJz4sZt; Sun, 30 May 2021 14:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 319391E831; Sun, 30 May 2021 14:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14UEYVvT036282; Sun, 30 May 2021 14:34:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14UEYVWS036281; Sun, 30 May 2021 14:34:31 GMT (envelope-from git) Date: Sun, 30 May 2021 14:34:31 GMT Message-Id: <202105301434.14UEYVWS036281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 21d91f53d793 - stable/12 - libalias: Fix remaining compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 21d91f53d793890fd403907717ee12286956bba5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 May 2021 14:34:31 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=21d91f53d793890fd403907717ee12286956bba5 commit 21d91f53d793890fd403907717ee12286956bba5 Author: Alex Richardson AuthorDate: 2021-01-19 11:32:32 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-05-30 14:31:41 +0000 libalias: Fix remaining compiler warnings This fixes some sign-compare warnings and adds a missing static to a variable declaration. Differential Revision: https://reviews.freebsd.org/D27883 --- sys/netinet/libalias/alias.c | 15 +++++++++------ sys/netinet/libalias/alias_mod.c | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c index 50545fbc037b..f9261e394157 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -442,7 +442,8 @@ static int IcmpAliasIn(struct libalias *la, struct ip *pip) { struct icmp *ic; - int dlen, iresult; + int iresult; + size_t dlen; LIBALIAS_LOCK_ASSERT(la); @@ -469,7 +470,7 @@ IcmpAliasIn(struct libalias *la, struct ip *pip) case ICMP_TIMXCEED: case ICMP_PARAMPROB: if (dlen < ICMP_ADVLENMIN || - dlen < ICMP_ADVLEN(ic)) + dlen < (size_t)ICMP_ADVLEN(ic)) return (PKT_ALIAS_IGNORED); iresult = IcmpAliasIn2(la, pip); break; @@ -739,7 +740,7 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; - int dlen; + size_t dlen; LIBALIAS_LOCK_ASSERT(la); @@ -838,7 +839,8 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) u_short dest_port; u_short proxy_server_port; int proxy_type; - int dlen, error; + int error; + size_t dlen; LIBALIAS_LOCK_ASSERT(la); @@ -943,7 +945,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; - int dlen; + size_t dlen; LIBALIAS_LOCK_ASSERT(la); @@ -1068,9 +1070,10 @@ TcpAliasIn(struct libalias *la, struct ip *pip) static int TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) { - int dlen, proxy_type, error; + int proxy_type, error; u_short dest_port; u_short proxy_server_port; + size_t dlen; struct in_addr dest_address; struct in_addr proxy_server_address; struct tcphdr *tc; diff --git a/sys/netinet/libalias/alias_mod.c b/sys/netinet/libalias/alias_mod.c index 8f1071ebc79e..835d76cf5152 100644 --- a/sys/netinet/libalias/alias_mod.c +++ b/sys/netinet/libalias/alias_mod.c @@ -129,7 +129,7 @@ first_handler(void) #ifndef _KERNEL /* Dll manipulation code - this code is not thread safe... */ -SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(dll_chain); +static SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(dll_chain); int attach_dll(struct dll *p) {