]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Jan Echternach's string_to_number bignum fixes.
authorJan Echternach <echter@informatik.uni-rostock.de>
Sun, 27 Aug 2000 07:41:39 +0000 (07:41 +0000)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 27 Aug 2000 07:41:39 +0000 (07:41 +0000)
ip6tables.c
iptables.c

index 27e7187c6e0bc22fff26e18bcd9cb082c6bbb7a1..4df70c824efce216d82e038cffabbdda5a95dd23 100644 (file)
@@ -745,14 +745,15 @@ parse_target(const char *targetname)
 int
 string_to_number(const char *s, int min, int max)
 {
-       int number;
+       long number;
        char *end;
 
        /* Handle hex, octal, etc. */
-       number = (int)strtol(s, &end, 0);
+       errno = 0;
+       number = strtol(s, &end, 0);
        if (*end == '\0' && end != s) {
                /* we parsed a number, let's see if we want this */
-               if (min <= number && number <= max)
+               if (errno != ERANGE && min <= number && number <= max)
                        return number;
        }
        return -1;
@@ -818,7 +819,7 @@ find_target(const char *name, enum ip6t_tryload tryload)
 }
 
 static struct option *
-merge_options(struct option *oldopts, struct option *newopts,
+merge_options(struct option *oldopts, const struct option *newopts,
              unsigned int *option_offset)
 {
        unsigned int num_old, num_new, i;
index 92f0175dc076add73965b604adef21897cec63a5..2f18826080bfa23a6702947b95014d6b6a29d099 100644 (file)
@@ -200,6 +200,8 @@ static const struct pprot chain_protos[] = {
        { "tcp", IPPROTO_TCP },
        { "udp", IPPROTO_UDP },
        { "icmp", IPPROTO_ICMP },
+       { "esp", IPPROTO_ESP },
+       { "ah", IPPROTO_AH },
        { "all", 0 },
 };