Author: melifaro
Date: Fri Oct 17 20:47:55 2014
New Revision: 273241
URL: https://svnweb.freebsd.org/changeset/base/273241

Log:
  * Fix table sets handling.
  * Simplify formatting.
  
  Suggested by: luigi

Modified:
  head/sbin/ipfw/ipfw2.c
  head/sbin/ipfw/tables.c

Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c      Fri Oct 17 20:39:39 2014        (r273240)
+++ head/sbin/ipfw/ipfw2.c      Fri Oct 17 20:47:55 2014        (r273241)
@@ -2138,7 +2138,7 @@ ipfw_sets_handler(char *av[])
 {
        uint32_t masks[2];
        int i;
-       uint8_t cmd, new_set, rulenum;
+       uint8_t cmd, rulenum;
        ipfw_range_tlv rt;
        char *msg;
        size_t size;
@@ -2202,7 +2202,7 @@ ipfw_sets_handler(char *av[])
                if (!isdigit(*(av[0])) || (cmd == 3 && rt.set > RESVD_SET) ||
                        (cmd == 2 && rt.start_rule == IPFW_DEFAULT_RULE) )
                        errx(EX_DATAERR, "invalid source number %s\n", av[0]);
-               if (!isdigit(*(av[2])) || new_set > RESVD_SET)
+               if (!isdigit(*(av[2])) || rt.new_set > RESVD_SET)
                        errx(EX_DATAERR, "invalid dest. set %s\n", av[1]);
                i = do_range_cmd(cmd, &rt);
        } else if (_substrcmp(*av, "disable") == 0 ||
@@ -2543,6 +2543,7 @@ ipfw_show_config(struct cmdline_opts *co
        dynbase = NULL;
        dynsz = 0;
        read = sizeof(*cfg);
+       rcnt = 0;
 
        fo->set_mask = cfg->set_mask;
 

Modified: head/sbin/ipfw/tables.c
==============================================================================
--- head/sbin/ipfw/tables.c     Fri Oct 17 20:39:39 2014        (r273240)
+++ head/sbin/ipfw/tables.c     Fri Oct 17 20:47:55 2014        (r273241)
@@ -1908,7 +1908,7 @@ ipfw_list_values(int ac, char *av[])
        for (i = 0; i < olh->count; i++) {
                table_show_value(buf, sizeof(buf), (ipfw_table_value *)v,
                    vmask, 0);
-               printf("[%u] refs=%ju %s\n", v->spare1, v->refcnt, buf);
+               printf("[%u] refs=%lu %s\n", v->spare1, (u_long)v->refcnt, buf);
                v = (struct _table_value *)((caddr_t)v + olh->objsize);
        }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to