diff options
author | mlaier <mlaier@FreeBSD.org> | 2005-05-03 16:47:37 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2005-05-03 16:47:37 +0000 |
commit | 511d1c13c361b4534ed4c6f973fd891d95055cab (patch) | |
tree | bab48c44c0d19fa874cf07baf703335409f81c2b /contrib/pf/pfctl/pfctl_osfp.c | |
parent | 51d3d6ad22798e39cfde335297ece533ba5b6fb6 (diff) | |
download | FreeBSD-src-511d1c13c361b4534ed4c6f973fd891d95055cab.zip FreeBSD-src-511d1c13c361b4534ed4c6f973fd891d95055cab.tar.gz |
Import pf userland from OpenBSD 3.7 (OPENBSD_3_7 as of today)
Diffstat (limited to 'contrib/pf/pfctl/pfctl_osfp.c')
-rw-r--r-- | contrib/pf/pfctl/pfctl_osfp.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/contrib/pf/pfctl/pfctl_osfp.c b/contrib/pf/pfctl/pfctl_osfp.c index 6d1fb99..23e3ccc 100644 --- a/contrib/pf/pfctl/pfctl_osfp.c +++ b/contrib/pf/pfctl/pfctl_osfp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_osfp.c,v 1.8 2004/02/27 10:42:00 henning Exp $ */ +/* $OpenBSD: pfctl_osfp.c,v 1.12 2005/02/17 13:18:00 aaron Exp $ */ /* * Copyright (c) 2003 Mike Frantzen <frantzen@openbsd.org> @@ -97,8 +97,8 @@ pfctl_file_fingerprints(int dev, int opts, const char *fp_filename) pfctl_flush_my_fingerprints(&classes); - if ((in = fopen(fp_filename, "r")) == NULL) { - warn("fopen(%s)", fp_filename); + if ((in = pfctl_fopen(fp_filename, "r")) == NULL) { + warn("%s", fp_filename); return (1); } class = version = subtype = desc = tcpopts = NULL; @@ -276,9 +276,9 @@ pfctl_flush_my_fingerprints(struct name_list *list) while ((nm = LIST_FIRST(list)) != NULL) { LIST_REMOVE(nm, nm_entry); pfctl_flush_my_fingerprints(&nm->nm_sublist); - fingerprint_count--; free(nm); } + fingerprint_count = 0; class_count = 0; } @@ -348,7 +348,7 @@ pfctl_get_fingerprint(const char *name) if ((wr_name = strdup(name)) == NULL) err(1, "malloc"); - if ((ptr = index(wr_name, ' ')) == NULL) { + if ((ptr = strchr(wr_name, ' ')) == NULL) { free(wr_name); return (PF_OSFP_NOMATCH); } @@ -508,9 +508,9 @@ found: strlcat(buf, " ", len); strlcat(buf, version_name, len); if (subtype_name) { - if (index(version_name, ' ')) + if (strchr(version_name, ' ')) strlcat(buf, " ", len); - else if (index(version_name, '.') && + else if (strchr(version_name, '.') && isdigit(*subtype_name)) strlcat(buf, ".", len); else @@ -702,9 +702,8 @@ fingerprint_name_entry(struct name_list *list, char *name) nm_entry = calloc(1, sizeof(*nm_entry)); if (nm_entry == NULL) err(1, "calloc"); - LIST_INIT(&nm_entry->nm_sublist); - strlcpy(nm_entry->nm_name, name, - sizeof(nm_entry->nm_name)); + LIST_INIT(&nm_entry->nm_sublist); + strlcpy(nm_entry->nm_name, name, sizeof(nm_entry->nm_name)); } LIST_INSERT_HEAD(list, nm_entry, nm_entry); return (nm_entry); |