summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw/ipfw2.c
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2012-07-30 10:55:23 +0000
committerluigi <luigi@FreeBSD.org>2012-07-30 10:55:23 +0000
commitd8e2c218a2f038ccc70ed8fe056b40c23f743930 (patch)
treebb2da67336098c00fc68c385ace105f6b2d5574f /sbin/ipfw/ipfw2.c
parent22e90367b6a306c0a5627973056fd5da0c68e413 (diff)
downloadFreeBSD-src-d8e2c218a2f038ccc70ed8fe056b40c23f743930.zip
FreeBSD-src-d8e2c218a2f038ccc70ed8fe056b40c23f743930.tar.gz
Fix some compile errors at high WARNS, including one
for an uninitialized variable. unused parameters and variables are annotated with (void)foo; /* UNUSED */ instead of __unused, because this code needs to build also on linux and windows.
Diffstat (limited to 'sbin/ipfw/ipfw2.c')
-rw-r--r--sbin/ipfw/ipfw2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index dd22ad0..f714035 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -412,7 +412,7 @@ do_cmd(int optname, void *optval, uintptr_t optlen)
* and calls setsockopt().
* Function returns 0 on success or -1 otherwise.
*/
-int
+static int
do_setcmd3(int optname, void *optval, socklen_t optlen)
{
socklen_t len;
@@ -3930,6 +3930,7 @@ ipfw_table_handler(int ac, char *av[])
uint32_t a, type, mask, addrlen;
uint32_t tables_max;
+ mask = 0; // XXX uninitialized ?
len = sizeof(tables_max);
if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len,
NULL, 0) == -1)
@@ -4135,7 +4136,7 @@ table_list(uint16_t num, int need_header)
if (sz < xent->len)
break;
sz -= xent->len;
- xent = (void *)xent + xent->len;
+ xent = (ipfw_table_xentry *)((char *)xent + xent->len);
}
free(tbl);
OpenPOWER on IntegriCloud