From 22c343ffc85c67a0d3819d7b60d9805851a1c0de Mon Sep 17 00:00:00 2001 From: darrenr Date: Thu, 23 Jun 2005 14:19:02 +0000 Subject: Fix some minor problems before release: (1) "ipf -T" is broken for fetching single entries and (2) loading rules with numbered collections does not order insertion right. (3) stats aren't accumulated for hash table memory failures Approved by: re (dwhite) --- contrib/ipfilter/lib/ipf_dotuning.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'contrib/ipfilter/lib') diff --git a/contrib/ipfilter/lib/ipf_dotuning.c b/contrib/ipfilter/lib/ipf_dotuning.c index d9f5f75..3f146d7 100644 --- a/contrib/ipfilter/lib/ipf_dotuning.c +++ b/contrib/ipfilter/lib/ipf_dotuning.c @@ -33,6 +33,7 @@ ioctlfunc_t iocfn; printtunable(&tu); } } else if ((t = strchr(s, '=')) != NULL) { + tu.ipft_cookie = NULL; *t++ = '\0'; strncpy(tu.ipft_name, s, sizeof(tu.ipft_name)); if (sscanf(t, "%lu", &tu.ipft_vlong) == 1) { @@ -45,13 +46,16 @@ ioctlfunc_t iocfn; return; } } else { + tu.ipft_cookie = NULL; strncpy(tu.ipft_name, s, sizeof(tu.ipft_name)); if ((*iocfn)(fd, SIOCIPFGET, &obj) == -1) { perror("ioctl(SIOCIPFGET)"); return; } - if (tu.ipft_cookie == NULL) + if (tu.ipft_cookie == NULL) { + fprintf(stderr, "Null cookie for %s\n", s); return; + } tu.ipft_name[sizeof(tu.ipft_name) - 1] = '\0'; printtunable(&tu); -- cgit v1.1