From e28cb0253763efc40ce50907d66fe5d2655ca23a Mon Sep 17 00:00:00 2001 From: David Malone Date: Sun, 20 Aug 2006 20:10:36 +0000 Subject: [PATCH] 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 --- sbin/ipfw/ipfw2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index a461f766577..26ffb42b0e6 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);