diff options
author | kn <kn@cvs.openbsd.org> | 2019-01-19 11:48:55 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2019-01-19 11:48:55 +0000 |
commit | 3f044edeea6a5fe5c12bd66aa373f06fc45bd851 (patch) | |
tree | e184ea50c380e516f4768c22a7304bf610ef6c91 /sbin | |
parent | dce713c2b979d24a07bda626739b4c5d68575567 (diff) |
Use mnemonic PFCTL_SHOW_* macros, terminate string with null character
Tweak spacing while here, no object change.
Feedback and OK procter, OK sceloha
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/pfctl.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index d9d0a9b42d4..0fee44796c1 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl.c,v 1.365 2019/01/11 03:09:24 kn Exp $ */ +/* $OpenBSD: pfctl.c,v 1.366 2019/01/19 11:48:54 kn Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1485,7 +1485,6 @@ pfctl_load_ruleset(struct pfctl *pf, char *path, struct pf_ruleset *rs, } } else if (pf->opts & PF_OPT_VERBOSE) printf("\n"); - } if (pf->optimize) @@ -1851,7 +1850,6 @@ pfctl_set_limit(struct pfctl *pf, const char *opt, unsigned int limit) { int i; - for (i = 0; pf_limits[i].name; i++) { if (strcasecmp(opt, pf_limits[i].name) == 0) { pf->limit[pf_limits[i].index] = limit; @@ -2217,7 +2215,7 @@ pfctl_show_anchors(int dev, int opts, char *anchorname) err(1, "DIOCGETRULESET"); if (!strcmp(pr.name, PF_RESERVED_ANCHOR)) continue; - sub[0] = 0; + sub[0] = '\0'; if (pr.path[0]) { strlcat(sub, pr.path, sizeof(sub)); strlcat(sub, "/", sizeof(sub)); @@ -2235,6 +2233,7 @@ const char * pfctl_lookup_option(char *cmd, const char **list) { const char *item = NULL; + if (cmd != NULL && *cmd) for (; *list; list++) if (!strncmp(cmd, *list, strlen(cmd))) { @@ -2580,15 +2579,15 @@ main(int argc, char *argv[]) opts |= PF_OPT_SHOWALL; pfctl_load_fingerprints(dev, opts); - pfctl_show_rules(dev, path, opts, 0, anchorname, - 0, 0, -1); + pfctl_show_rules(dev, path, opts, PFCTL_SHOW_RULES, + anchorname, 0, 0, -1); pfctl_show_queues(dev, ifaceopt, opts, opts & PF_OPT_VERBOSE2); pfctl_show_states(dev, ifaceopt, opts, -1); pfctl_show_src_nodes(dev, opts); pfctl_show_status(dev, opts); - pfctl_show_rules(dev, path, opts, 1, anchorname, - 0, 0, -1); + pfctl_show_rules(dev, path, opts, PFCTL_SHOW_LABELS, + anchorname, 0, 0, -1); pfctl_show_timeouts(dev, opts); pfctl_show_limits(dev, opts); pfctl_show_tables(anchorname, opts); |