summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2006-03-05 15:55:46 +0000
committerume <ume@FreeBSD.org>2006-03-05 15:55:46 +0000
commita9ea2a9a097f07173b47dd0bdcc0e6b06c975001 (patch)
tree69a16d73dba2d8828548939779788ec4845812e8
parentcdffa6c05c2e683c57b376fca2961e509e017e2a (diff)
downloadFreeBSD-src-a9ea2a9a097f07173b47dd0bdcc0e6b06c975001.zip
FreeBSD-src-a9ea2a9a097f07173b47dd0bdcc0e6b06c975001.tar.gz
Revert `proto ip' back to the previous behavior. The kernel side of
ipfw2 doesn't allow zero as protocol number. MFC after: 3 days
-rw-r--r--sbin/ipfw/ipfw.82
-rw-r--r--sbin/ipfw/ipfw2.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index 911af5c..679b980 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -845,8 +845,6 @@ Matches any packet.
.El
.Pp
The
-.Cm ip
-and
.Cm ipv6
in
.Cm proto
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 9ce30b8..195e991 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -3590,8 +3590,8 @@ add_proto0(ipfw_insn *cmd, char *av, u_char *protop)
char *ep;
int proto;
- proto = strtol(av, &ep, 0);
- if (*ep != '\0' || proto < 0) {
+ proto = strtol(av, &ep, 10);
+ if (*ep != '\0' || proto <= 0) {
if ((pe = getprotobyname(av)) == NULL)
return NULL;
proto = pe->p_proto;
@@ -3607,7 +3607,7 @@ add_proto(ipfw_insn *cmd, char *av, u_char *protop)
{
u_char proto = IPPROTO_IP;
- if (_substrcmp(av, "all") == 0)
+ if (_substrcmp(av, "all") == 0 || strcmp(av, "ip") == 0)
; /* do not set O_IP4 nor O_IP6 */
else if (strcmp(av, "ip4") == 0)
/* explicit "just IPv4" rule */
OpenPOWER on IntegriCloud