git: 21d91f53d793 - stable/12 - libalias: Fix remaining compiler warnings
Lutz Donnerhacke
donner at FreeBSD.org
Sun May 30 14:34:31 UTC 2021
The branch stable/12 has been updated by donner:
URL: https://cgit.FreeBSD.org/src/commit/?id=21d91f53d793890fd403907717ee12286956bba5
commit 21d91f53d793890fd403907717ee12286956bba5
Author: Alex Richardson <arichardson at FreeBSD.org>
AuthorDate: 2021-01-19 11:32:32 +0000
Commit: Lutz Donnerhacke <donner at FreeBSD.org>
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)
{
More information about the dev-commits-src-all
mailing list