diff options
author | Niels Provos <provos@cvs.openbsd.org> | 2001-06-27 02:45:59 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 2001-06-27 02:45:59 +0000 |
commit | 9bdef3615072a1fcf491719ee97e861d42a3296b (patch) | |
tree | 23b10c96a46713cfc961fb9ec436c65ca9210e49 /sbin/pfctl/pfctl_parser.c | |
parent | bad1a43bd974049eae3bda25666595f846c21d6b (diff) |
make it understand protocol numbers, too
Diffstat (limited to 'sbin/pfctl/pfctl_parser.c')
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index af04f72620f..7001864e009 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.17 2001/06/26 22:56:01 dugsong Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.18 2001/06/27 02:45:58 provos Exp $ */ /* * Copyright (c) 2001, Daniel Hartmeier @@ -659,6 +659,11 @@ parse_rule(int n, char *l, struct pf_rule *r) w = next_word(&l); p = getprotobyname(w); if (p == NULL) { + int proto = atoi(w); + if (proto > 0) + p = getprotobynumber(proto); + } + if (p == NULL) { error(n, "unknown protocol %s\n", w); return (0); } |