mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
ipfw: Remove set but unused variables.
Reported by: GCC Differential Revision: https://reviews.freebsd.org/D40654
This commit is contained in:
parent
a7f25f141a
commit
f5e7330633
|
@ -1074,7 +1074,6 @@ nat_foreach(nat_cb_t *f, void *arg, int sort)
|
||||||
struct nat44_cfg_nat *cfg;
|
struct nat44_cfg_nat *cfg;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int error;
|
|
||||||
|
|
||||||
/* Start with reasonable default */
|
/* Start with reasonable default */
|
||||||
sz = sizeof(*olh) + 16 * sizeof(struct nat44_cfg_nat);
|
sz = sizeof(*olh) + 16 * sizeof(struct nat44_cfg_nat);
|
||||||
|
@ -1097,7 +1096,7 @@ nat_foreach(nat_cb_t *f, void *arg, int sort)
|
||||||
|
|
||||||
cfg = (struct nat44_cfg_nat*)(olh + 1);
|
cfg = (struct nat44_cfg_nat*)(olh + 1);
|
||||||
for (i = 0; i < olh->count; i++) {
|
for (i = 0; i < olh->count; i++) {
|
||||||
error = f(cfg, arg); /* Ignore errors for now */
|
(void)f(cfg, arg); /* Ignore errors for now */
|
||||||
cfg = (struct nat44_cfg_nat *)((caddr_t)cfg +
|
cfg = (struct nat44_cfg_nat *)((caddr_t)cfg +
|
||||||
olh->objsize);
|
olh->objsize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -505,7 +505,6 @@ nat64clat_foreach(nat64clat_cb_t *f, const char *name, uint8_t set, int sort)
|
||||||
ipfw_nat64clat_cfg *cfg;
|
ipfw_nat64clat_cfg *cfg;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int error;
|
|
||||||
|
|
||||||
/* Start with reasonable default */
|
/* Start with reasonable default */
|
||||||
sz = sizeof(*olh) + 16 * sizeof(*cfg);
|
sz = sizeof(*olh) + 16 * sizeof(*cfg);
|
||||||
|
@ -528,7 +527,7 @@ nat64clat_foreach(nat64clat_cb_t *f, const char *name, uint8_t set, int sort)
|
||||||
|
|
||||||
cfg = (ipfw_nat64clat_cfg *)(olh + 1);
|
cfg = (ipfw_nat64clat_cfg *)(olh + 1);
|
||||||
for (i = 0; i < olh->count; i++) {
|
for (i = 0; i < olh->count; i++) {
|
||||||
error = f(cfg, name, set); /* Ignore errors for now */
|
(void)f(cfg, name, set); /* Ignore errors for now */
|
||||||
cfg = (ipfw_nat64clat_cfg *)((caddr_t)cfg +
|
cfg = (ipfw_nat64clat_cfg *)((caddr_t)cfg +
|
||||||
olh->objsize);
|
olh->objsize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -853,7 +853,6 @@ nat64lsn_foreach(nat64lsn_cb_t *f, const char *name, uint8_t set, int sort)
|
||||||
ipfw_nat64lsn_cfg *cfg;
|
ipfw_nat64lsn_cfg *cfg;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int error;
|
|
||||||
|
|
||||||
/* Start with reasonable default */
|
/* Start with reasonable default */
|
||||||
sz = sizeof(*olh) + 16 * sizeof(ipfw_nat64lsn_cfg);
|
sz = sizeof(*olh) + 16 * sizeof(ipfw_nat64lsn_cfg);
|
||||||
|
@ -877,7 +876,7 @@ nat64lsn_foreach(nat64lsn_cb_t *f, const char *name, uint8_t set, int sort)
|
||||||
|
|
||||||
cfg = (ipfw_nat64lsn_cfg *)(olh + 1);
|
cfg = (ipfw_nat64lsn_cfg *)(olh + 1);
|
||||||
for (i = 0; i < olh->count; i++) {
|
for (i = 0; i < olh->count; i++) {
|
||||||
error = f(cfg, name, set); /* Ignore errors for now */
|
(void)f(cfg, name, set); /* Ignore errors for now */
|
||||||
cfg = (ipfw_nat64lsn_cfg *)((caddr_t)cfg +
|
cfg = (ipfw_nat64lsn_cfg *)((caddr_t)cfg +
|
||||||
olh->objsize);
|
olh->objsize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -521,7 +521,6 @@ nat64stl_foreach(nat64stl_cb_t *f, const char *name, uint8_t set, int sort)
|
||||||
ipfw_nat64stl_cfg *cfg;
|
ipfw_nat64stl_cfg *cfg;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int error;
|
|
||||||
|
|
||||||
/* Start with reasonable default */
|
/* Start with reasonable default */
|
||||||
sz = sizeof(*olh) + 16 * sizeof(*cfg);
|
sz = sizeof(*olh) + 16 * sizeof(*cfg);
|
||||||
|
@ -544,7 +543,7 @@ nat64stl_foreach(nat64stl_cb_t *f, const char *name, uint8_t set, int sort)
|
||||||
|
|
||||||
cfg = (ipfw_nat64stl_cfg *)(olh + 1);
|
cfg = (ipfw_nat64stl_cfg *)(olh + 1);
|
||||||
for (i = 0; i < olh->count; i++) {
|
for (i = 0; i < olh->count; i++) {
|
||||||
error = f(cfg, name, set); /* Ignore errors for now */
|
(void)f(cfg, name, set); /* Ignore errors for now */
|
||||||
cfg = (ipfw_nat64stl_cfg *)((caddr_t)cfg +
|
cfg = (ipfw_nat64stl_cfg *)((caddr_t)cfg +
|
||||||
olh->objsize);
|
olh->objsize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -420,7 +420,6 @@ nptv6_foreach(nptv6_cb_t *f, const char *name, uint8_t set, int sort)
|
||||||
ipfw_nptv6_cfg *cfg;
|
ipfw_nptv6_cfg *cfg;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int error;
|
|
||||||
|
|
||||||
/* Start with reasonable default */
|
/* Start with reasonable default */
|
||||||
sz = sizeof(*olh) + 16 * sizeof(*cfg);
|
sz = sizeof(*olh) + 16 * sizeof(*cfg);
|
||||||
|
@ -442,7 +441,7 @@ nptv6_foreach(nptv6_cb_t *f, const char *name, uint8_t set, int sort)
|
||||||
|
|
||||||
cfg = (ipfw_nptv6_cfg *)(olh + 1);
|
cfg = (ipfw_nptv6_cfg *)(olh + 1);
|
||||||
for (i = 0; i < olh->count; i++) {
|
for (i = 0; i < olh->count; i++) {
|
||||||
error = f(cfg, name, set);
|
(void)f(cfg, name, set);
|
||||||
cfg = (ipfw_nptv6_cfg *)((caddr_t)cfg + olh->objsize);
|
cfg = (ipfw_nptv6_cfg *)((caddr_t)cfg + olh->objsize);
|
||||||
}
|
}
|
||||||
free(olh);
|
free(olh);
|
||||||
|
|
|
@ -1408,7 +1408,6 @@ guess_key_type(char *key, uint8_t *ptype)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
struct in6_addr addr;
|
struct in6_addr addr;
|
||||||
uint32_t kv;
|
|
||||||
|
|
||||||
if (ishexnumber(*key) != 0 || *key == ':') {
|
if (ishexnumber(*key) != 0 || *key == ':') {
|
||||||
/* Remove / if exists */
|
/* Remove / if exists */
|
||||||
|
@ -1424,7 +1423,7 @@ guess_key_type(char *key, uint8_t *ptype)
|
||||||
} else {
|
} else {
|
||||||
/* Port or any other key */
|
/* Port or any other key */
|
||||||
/* Skip non-base 10 entries like 'fa1' */
|
/* Skip non-base 10 entries like 'fa1' */
|
||||||
kv = strtol(key, &p, 10);
|
(void)strtol(key, &p, 10);
|
||||||
if (*p == '\0') {
|
if (*p == '\0') {
|
||||||
*ptype = IPFW_TABLE_NUMBER;
|
*ptype = IPFW_TABLE_NUMBER;
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -1712,7 +1711,6 @@ tables_foreach(table_cb_t *f, void *arg, int sort)
|
||||||
ipfw_xtable_info *info;
|
ipfw_xtable_info *info;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int error;
|
|
||||||
|
|
||||||
/* Start with reasonable default */
|
/* Start with reasonable default */
|
||||||
sz = sizeof(*olh) + 16 * sizeof(ipfw_xtable_info);
|
sz = sizeof(*olh) + 16 * sizeof(ipfw_xtable_info);
|
||||||
|
@ -1737,7 +1735,7 @@ tables_foreach(table_cb_t *f, void *arg, int sort)
|
||||||
info = (ipfw_xtable_info *)(olh + 1);
|
info = (ipfw_xtable_info *)(olh + 1);
|
||||||
for (i = 0; i < olh->count; i++) {
|
for (i = 0; i < olh->count; i++) {
|
||||||
if (g_co.use_set == 0 || info->set == g_co.use_set - 1)
|
if (g_co.use_set == 0 || info->set == g_co.use_set - 1)
|
||||||
error = f(info, arg);
|
(void)f(info, arg);
|
||||||
info = (ipfw_xtable_info *)((caddr_t)info +
|
info = (ipfw_xtable_info *)((caddr_t)info +
|
||||||
olh->objsize);
|
olh->objsize);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue