summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarc <marc>2000-04-22 22:34:44 +0000
committermarc <marc>2000-04-22 22:34:44 +0000
commit3dddbc62dcca232393ca9f334f33add1ecc73d69 (patch)
tree03dde5429495b75e000340d85cded43efedda2f5
parent03650e38c9046cd58c19330abb5656700d7a65c7 (diff)
Improved iptc_set_policy error messages.
-rw-r--r--libiptc/libiptc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index e0da662..697b750 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -1453,10 +1453,11 @@ iptc_set_policy(const ipt_chainlabel chain,
struct ipt_standard_target *t;
CHECK(*handle);
+ iptc_fn = iptc_set_policy;
/* Figure out which chain. */
hook = iptc_builtin(chain, *handle);
if (hook == 0) {
- errno = EINVAL;
+ errno = ENOENT;
return 0;
} else
hook--;
@@ -1656,10 +1657,14 @@ iptc_strerror(int err)
{ iptc_insert_entry, EINVAL, "Target problem" },
/* EINVAL for CHECK probably means bad interface. */
{ iptc_check_packet, EINVAL,
- "bad arguments (does that interface exist?)" },
+ "Bad arguments (does that interface exist?)" },
/* ENOENT for DELETE probably means no matching rule */
{ iptc_delete_entry, ENOENT,
- "bad rule (does a matching rule exist in that chain?)" },
+ "Bad rule (does a matching rule exist in that chain?)" },
+ { iptc_set_policy, ENOENT,
+ "Bad built-in chain name" },
+ { iptc_set_policy, EINVAL,
+ "Bad policy name" },
{ NULL, ENOENT, "No extended target/match by that name" }
};