From a8757107547bd4efea6f27b16241aff738baf135 Mon Sep 17 00:00:00 2001 From: Mike Frantzen Date: Tue, 14 Dec 2004 17:03:50 +0000 Subject: 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 --- sbin/pfctl/pfctl_optimize.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sbin/pfctl') 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 @@ -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); } -- cgit v1.2.3