aboutsummaryrefslogtreecommitdiff
path: root/sbin/ipfw/nptv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ipfw/nptv6.c')
-rw-r--r--sbin/ipfw/nptv6.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/sbin/ipfw/nptv6.c b/sbin/ipfw/nptv6.c
index a2f6a97ae2a7..f2ebbdb65185 100644
--- a/sbin/ipfw/nptv6.c
+++ b/sbin/ipfw/nptv6.c
@@ -89,8 +89,8 @@ ipfw_nptv6_handler(int ac, char *av[])
int tcmd;
uint8_t set;
- if (co.use_set != 0)
- set = co.use_set - 1;
+ if (g_co.use_set != 0)
+ set = g_co.use_set - 1;
else
set = 0;
ac--; av++;
@@ -193,7 +193,7 @@ nptv6_create(const char *name, uint8_t set, int ac, char *av[])
ipfw_nptv6_cfg *cfg;
ipfw_obj_lheader *olh;
int tcmd, flags, plen;
- char *p = "\0";
+ char *p;
plen = 0;
memset(buf, 0, sizeof(buf));
@@ -326,7 +326,7 @@ nptv6_stats(const char *name, uint8_t set)
if (nptv6_get_stats(name, set, &stats) != 0)
err(EX_OSERR, "Error retrieving stats");
- if (co.use_set != 0 || set != 0)
+ if (g_co.use_set != 0 || set != 0)
printf("set %u ", set);
printf("nptv6 %s\n", name);
printf("\t%ju packets translated (internal to external)\n",
@@ -360,10 +360,10 @@ nptv6_show_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t set)
if (name != NULL && strcmp(cfg->name, name) != 0)
return (ESRCH);
- if (co.use_set != 0 && cfg->set != set)
+ if (g_co.use_set != 0 && cfg->set != set)
return (ESRCH);
- if (co.use_set != 0 || cfg->set != 0)
+ if (g_co.use_set != 0 || cfg->set != 0)
printf("set %u ", cfg->set);
inet_ntop(AF_INET6, &cfg->internal, abuf, sizeof(abuf));
printf("nptv6 %s int_prefix %s ", cfg->name, abuf);
@@ -378,10 +378,10 @@ nptv6_show_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t set)
}
static int
-nptv6_destroy_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t set)
+nptv6_destroy_cb(ipfw_nptv6_cfg *cfg, const char *name __unused, uint8_t set)
{
- if (co.use_set != 0 && cfg->set != set)
+ if (g_co.use_set != 0 && cfg->set != set)
return (ESRCH);
nptv6_destroy(cfg->name, cfg->set);
@@ -396,10 +396,10 @@ nptv6_destroy_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t set)
static int
nptv6name_cmp(const void *a, const void *b)
{
- ipfw_nptv6_cfg *ca, *cb;
+ const ipfw_nptv6_cfg *ca, *cb;
- ca = (ipfw_nptv6_cfg *)a;
- cb = (ipfw_nptv6_cfg *)b;
+ ca = (const ipfw_nptv6_cfg *)a;
+ cb = (const ipfw_nptv6_cfg *)b;
if (ca->set > cb->set)
return (1);
@@ -419,7 +419,8 @@ nptv6_foreach(nptv6_cb_t *f, const char *name, uint8_t set, int sort)
ipfw_obj_lheader *olh;
ipfw_nptv6_cfg *cfg;
size_t sz;
- int i, error;
+ uint32_t i;
+ int error;
/* Start with reasonable default */
sz = sizeof(*olh) + 16 * sizeof(*cfg);