summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl.c
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-03-27 20:21:35 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-03-27 20:21:35 +0000
commit76deddc206b72ecfe50ddc6a7f4ee4ea126c25f4 (patch)
tree6771b8d5205c55a8841c6acd35bbadc9fa4833a2 /sbin/pfctl/pfctl.c
parentb8b452684395b694846dacf3144d0998d6b07c9a (diff)
minor tweaks from Andrey Matveev, ok henning@ and cedric@
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r--sbin/pfctl/pfctl.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 785c0f83c6e..0d534e21a46 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.162 2003/03/27 18:01:57 henning Exp $ */
+/* $OpenBSD: pfctl.c,v 1.163 2003/03/27 20:21:34 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -429,7 +429,7 @@ pfctl_kill_states(int dev, int opts)
((struct sockaddr_in6 *)resp[0]->ai_addr)->
sin6_addr;
else
- errx(1, "Unknown address family!?!?!");
+ errx(1, "Unknown address family %d", psk.psk_af);
if (state_killers > 1) {
dests = 0;
@@ -464,7 +464,8 @@ pfctl_kill_states(int dev, int opts)
((struct sockaddr_in6 *)resp[1]->
ai_addr)->sin6_addr;
else
- errx(1, "Unknown address family!?!?!");
+ errx(1, "Unknown address family %d",
+ psk.psk_af);
if (ioctl(dev, DIOCKILLSTATES, &psk))
err(1, "DIOCKILLSTATES");
@@ -979,13 +980,12 @@ pfctl_rules(int dev, char *filename, int opts)
fin = stdin;
infile = "stdin";
} else {
- fin = fopen(filename, "r");
+ if ((fin = fopen(filename, "r")) == NULL) {
+ warn("%s", filename);
+ return (1);
+ }
infile = filename;
}
- if (fin == NULL) {
- warn("%s", filename);
- return (1);
- }
if ((opts & PF_OPT_NOACTION) == 0) {
if ((loadopt & (PFCTL_FLAG_NAT | PFCTL_FLAG_ALL)) != 0) {
pr[PF_RULESET_NAT].rule.action = PF_NAT;
@@ -1024,7 +1024,7 @@ pfctl_rules(int dev, char *filename, int opts)
}
pf.rule_nr = 0;
if (parse_rules(fin, &pf) < 0)
- errx(1, "Syntax error in file: pf rules not loaded");
+ errx(1, "Syntax error in config file: pf rules not loaded");
if ((altqsupport && (loadopt & (PFCTL_FLAG_ALTQ | PFCTL_FLAG_ALL)) != 0))
if (check_commit_altq(dev, opts) != 0)
errx(1, "errors in altq config");