diff options
author | Mike Frantzen <frantzen@cvs.openbsd.org> | 2004-12-14 17:03:50 +0000 |
---|---|---|
committer | Mike Frantzen <frantzen@cvs.openbsd.org> | 2004-12-14 17:03:50 +0000 |
commit | a8757107547bd4efea6f27b16241aff738baf135 (patch) | |
tree | 84f593ffd9b9ca5923b0f40a4664eccc6682c661 /sbin/pfctl | |
parent | ffd3a21a5c52e2195707a63be6a637530a79833c (diff) |
add two warn() calls to make sure a warning message gets printed if one of
the table calls fails and the optimizer is gonna bomb out
Diffstat (limited to 'sbin/pfctl')
-rw-r--r-- | sbin/pfctl/pfctl_optimize.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index 41bd70c845a..221d8e7a2e4 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_optimize.c,v 1.2 2004/08/08 19:04:25 deraadt Exp $ */ +/* $OpenBSD: pfctl_optimize.c,v 1.3 2004/12/14 17:03:49 frantzen Exp $ */ /* * Copyright (c) 2004 Mike Frantzen <frantzen@openbsd.org> @@ -1197,8 +1197,10 @@ add_opt_table(struct pfctl *pf, struct pf_opt_tbl **tbl, sa_family_t af, unmask(&node_host.addr.v.a.mask, af)); #endif /* OPT_DEBUG */ - if (append_addr_host((*tbl)->pt_buf, &node_host, 0, 0)) + if (append_addr_host((*tbl)->pt_buf, &node_host, 0, 0)) { + warn("failed to add host"); return (1); + } if (pf->opts & PF_OPT_VERBOSE) { struct node_tinit *ti; @@ -1264,8 +1266,10 @@ again: if (pfctl_define_table(tbl->pt_name, PFR_TFLAG_CONST, 1, pf->anchor, - tbl->pt_buf, pf->tticket)) + tbl->pt_buf, pf->tticket)) { + warn("failed to create table %s", tbl->pt_name); return (1); + } return (0); } |