diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2006-08-20 20:10:36 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2006-08-20 20:10:36 +0000 |
commit | b6bc6170e95bbe29f1ab91fe7bd5334eb1ef60e8 (patch) | |
tree | 8db6cddcfe5ed40431339a9ddfa1ad9f87a4c582 /sbin/ipfw | |
parent | b5d0670f93df932307af300907aa4f176c1efebe (diff) | |
download | FreeBSD-src-b6bc6170e95bbe29f1ab91fe7bd5334eb1ef60e8.zip FreeBSD-src-b6bc6170e95bbe29f1ab91fe7bd5334eb1ef60e8.tar.gz |
Regigle parens to try and get the intended affect. This should fix people
having trouble with the "me6" keyword. Also, we were using inet_pton on
the wrong variable in one place.
Reviewed by: mlaier (previous version of patch)
Obtained from: Sascha Blank (inet_pton change)
MFC after: 1 week
Diffstat (limited to 'sbin/ipfw')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index a461f76..26ffb42 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -3797,10 +3797,10 @@ add_src(ipfw_insn *cmd, char *av, u_char proto) inet_pton(AF_INET6, host, &a)) ret = add_srcip6(cmd, av); /* XXX: should check for IPv4, not !IPv6 */ - if ((ret == NULL) && proto == IPPROTO_IP || strcmp(av, "me") == 0 || - !inet_pton(AF_INET6, host, &a)) + if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || + !inet_pton(AF_INET6, host, &a))) ret = add_srcip(cmd, av); - if ((ret == NULL) && strcmp(av, "any") != 0) + if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; free(host); @@ -3823,10 +3823,10 @@ add_dst(ipfw_insn *cmd, char *av, u_char proto) inet_pton(AF_INET6, host, &a)) ret = add_dstip6(cmd, av); /* XXX: should check for IPv4, not !IPv6 */ - if ((ret == NULL) && proto == IPPROTO_IP || strcmp(av, "me") == 0 || - !inet_pton(AF_INET6, av, &a)) + if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || + !inet_pton(AF_INET6, host, &a))) ret = add_dstip(cmd, av); - if ((ret == NULL) && strcmp(av, "any") != 0) + if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; free(host); |