Date: Tue, 19 Jan 2021 21:38:16 GMT From: Alex Richardson <arichardson@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: be5972695f50 - main - libalias: Fix remaining compiler warnings Message-ID: <202101192138.10JLcG8g078432@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=be5972695f502ae92f675f35b543f6dc6aecb484 commit be5972695f502ae92f675f35b543f6dc6aecb484 Author: Alex Richardson <arichardson@FreeBSD.org> AuthorDate: 2021-01-19 11:32:32 +0000 Commit: Alex Richardson <arichardson@FreeBSD.org> CommitDate: 2021-01-19 21:23:24 +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 8d5097943080..900731fcbec6 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -435,7 +435,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); @@ -462,7 +463,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; @@ -728,7 +729,7 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; - int dlen; + size_t dlen; LIBALIAS_LOCK_ASSERT(la); @@ -827,7 +828,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); @@ -930,7 +932,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; - int dlen; + size_t dlen; LIBALIAS_LOCK_ASSERT(la); @@ -1055,9 +1057,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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101192138.10JLcG8g078432>