diff options
author | Patrick McHardy <kaber@trash.net> | 2006-12-02 17:17:33 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2006-12-02 17:17:33 +0000 |
commit | f9b7af8bc031472e488eb1feaca06cebbfe28e83 (patch) | |
tree | 9c42a3790d8607fbbff8a3cf81fb936001e6c0db | |
parent | 267a57007e69d8f316dea80f79ce2560459e0c30 (diff) |
Fix iptables-save not printing -s !0/0 and -d !0/0 as well as ip6tables
unnecessarily printing the address. Base on patch by Daniel De Graaf.
-rw-r--r-- | ip6tables-save.c | 2 | ||||
-rw-r--r-- | iptables-save.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ip6tables-save.c b/ip6tables-save.c index 37b1f197..486c5224 100644 --- a/ip6tables-save.c +++ b/ip6tables-save.c @@ -125,7 +125,7 @@ static void print_ip(char *prefix, const struct in6_addr *ip, const struct in6_a char buf[51]; int l = ipv6_prefix_length(mask); - if (!mask && !ip) + if (l == 0 && !invert) return; printf("%s %s%s", diff --git a/iptables-save.c b/iptables-save.c index 79b5dc7f..ee189182 100644 --- a/iptables-save.c +++ b/iptables-save.c @@ -141,7 +141,7 @@ static int print_match(const struct ipt_entry_match *e, /* print a given ip including mask if neccessary */ static void print_ip(char *prefix, u_int32_t ip, u_int32_t mask, int invert) { - if (!mask && !ip) + if (!mask && !ip && !invert) return; printf("%s %s%u.%u.%u.%u", |