diff options
author | fnm3 <fnm3> | 2002-11-25 09:00:29 +0000 |
---|---|---|
committer | fnm3 <fnm3> | 2002-11-25 09:00:29 +0000 |
commit | 40ba766d9dc68f751ba41f508bc6fd9f7d780a7b (patch) | |
tree | 4d5cae9e6d4e08984a64ad8d9e5cdb29cf4f6e04 | |
parent | d737cead0d53481cf6b97c56c795fe84d8caf35b (diff) |
Rolled back after invalid previous commit. Sorry.
-rw-r--r-- | userspace/ebtables2/extensions/ebt_ip.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/userspace/ebtables2/extensions/ebt_ip.c b/userspace/ebtables2/extensions/ebt_ip.c index 9ad272b..7a054ce 100644 --- a/userspace/ebtables2/extensions/ebt_ip.c +++ b/userspace/ebtables2/extensions/ebt_ip.c @@ -57,8 +57,6 @@ static struct option opts[] = { 0 } }; -struct protoent *p_ent; - // put the ip string into 4 bytes static int undot_ip(char *ip, unsigned char *ip2) { @@ -315,14 +313,9 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, ipinfo->invflags |= EBT_IP_PROTO; if (optind > argc) print_error("Missing IP protocol argument"); - (unsigned char) i = strtoul(argv[optind - 1], &end, 10); - if ((i > 0xFF) || (*end != '\0')) { - p_ent = getprotobyname(argv[optind - 1]); - if (p_ent == NULL) - print_error("Unknown Internet protocol %s ", - argv[optind - 1]); - i = p_ent->p_proto; - } + i = strtol(argv[optind - 1], &end, 10); + if (i < 0 || i > 255 || *end != '\0') + print_error("Problem with specified IP protocol"); ipinfo->protocol = i; ipinfo->bitmask |= EBT_IP_PROTO; break; |