Revert `proto ip' back to the previous behavior. The kernel side of

ipfw2 doesn't allow zero as protocol number.

MFC after:	3 days
This commit is contained in:
Hajimu UMEMOTO 2006-03-05 15:55:46 +00:00
parent 36f7af5781
commit c6ec022631
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=156315
2 changed files with 3 additions and 5 deletions

View File

@ -845,8 +845,6 @@ Matches any packet.
.El
.Pp
The
.Cm ip
and
.Cm ipv6
in
.Cm proto

View File

@ -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 */