aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2020-07-14 05:07:16 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2020-07-14 05:07:16 +0000
commit268a20a0e70d1f0167a3ff7f12815d2d778d899d (patch)
tree6a64537221dcb514242bdc7c23b321a51b87e946
parent14679cb2f3678c1bb7406e8e99fba5da2bb750b8 (diff)
downloadsrc-268a20a0e70d1f0167a3ff7f12815d2d778d899d.tar.gz
src-268a20a0e70d1f0167a3ff7f12815d2d778d899d.zip
[ipfw] quieten maybe-uninitialized errors in ipfw when compiled under mips-gcc-6.3.0.
This is mostly an exercise to set variables to NULL/0 when declared, but one was ensuring a string variable was set before printing it. We should never see "<unknown>" in a printed rule; if we do then this code definitely has some bugs that need addressing.
Notes
Notes: svn path=/head/; revision=363173
-rw-r--r--sbin/ipfw/dummynet.c4
-rw-r--r--sbin/ipfw/ipfw2.c12
-rw-r--r--sbin/ipfw/nat64lsn.c1
-rw-r--r--sbin/ipfw/tables.c4
4 files changed, 10 insertions, 11 deletions
diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c
index ef5b8b36efaa..24d835fbb98e 100644
--- a/sbin/ipfw/dummynet.c
+++ b/sbin/ipfw/dummynet.c
@@ -1279,8 +1279,8 @@ ipfw_config_pipe(int ac, char **av)
struct dn_profile *pf = NULL;
struct ipfw_flow_id *mask = NULL;
#ifdef NEW_AQM
- struct dn_extra_parms *aqm_extra;
- struct dn_extra_parms *sch_extra;
+ struct dn_extra_parms *aqm_extra = NULL;
+ struct dn_extra_parms *sch_extra = NULL;
int lmax_extra;
#endif
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 99513e71e3ff..d4c81d5e4d66 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -1618,6 +1618,9 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo,
case O_TCPWIN:
s = "tcpwin";
break;
+ default:
+ s = "<unknown>";
+ break;
}
bprintf(bp, " %s %u", s, cmd->arg1);
} else
@@ -4003,7 +4006,7 @@ chkarg:
struct addrinfo *res;
char *s, *end;
int family;
- u_short port_number;
+ u_short port_number = 0;
NEED1("missing forward address[:port]");
@@ -5600,7 +5603,7 @@ ifinfo_cmp(const void *a, const void *b)
static void
ipfw_list_tifaces(void)
{
- ipfw_obj_lheader *olh;
+ ipfw_obj_lheader *olh = NULL;
ipfw_iface_info *info;
uint32_t i;
int error;
@@ -5608,7 +5611,6 @@ ipfw_list_tifaces(void)
if ((error = ipfw_get_tracked_ifaces(&olh)) != 0)
err(EX_OSERR, "Unable to request ipfw tracked interface list");
-
qsort(olh + 1, olh->count, olh->objsize, ifinfo_cmp);
info = (ipfw_iface_info *)(olh + 1);
@@ -5625,7 +5627,3 @@ ipfw_list_tifaces(void)
free(olh);
}
-
-
-
-
diff --git a/sbin/ipfw/nat64lsn.c b/sbin/ipfw/nat64lsn.c
index aaceefca5ff8..ff36181815d9 100644
--- a/sbin/ipfw/nat64lsn.c
+++ b/sbin/ipfw/nat64lsn.c
@@ -99,6 +99,7 @@ nat64lsn_print_states(void *buf)
stg = (ipfw_nat64lsn_stg_v1 *)(od + 1);
sz = od->head.length - sizeof(*od);
next_idx = 0;
+ proto = NULL;
while (sz > 0 && next_idx != 0xFF) {
next_idx = stg->next.index;
sz -= sizeof(*stg);
diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c
index 4fc9e632a591..57b8cef00889 100644
--- a/sbin/ipfw/tables.c
+++ b/sbin/ipfw/tables.c
@@ -847,7 +847,7 @@ table_show_info(ipfw_xtable_info *i, void *arg)
static int
table_show_one(ipfw_xtable_info *i, void *arg)
{
- ipfw_obj_header *oh;
+ ipfw_obj_header *oh = NULL;
int error;
int is_all;
@@ -1179,7 +1179,7 @@ tentry_fill_key_type(char *arg, ipfw_obj_tentry *tentry, uint8_t type,
struct servent *sent;
int masklen;
- masklen = 0;
+ mask = masklen = 0;
af = 0;
paddr = (struct in6_addr *)&tentry->k;