struct ip6t_policy_info *info = (void *)(*match)->data;
struct ip6t_policy_elem *e = &info->pol[info->len];
struct in6_addr *addr = NULL, mask;
- unsigned int naddr = 0;
+ unsigned int naddr = 0, num;
int mode;
xtables_check_inverse(optarg, &invert, &optind, 0);
e->match.reqid = 1;
e->invert.reqid = invert;
- e->reqid = strtoul(argv[optind-1], NULL, 10);
+ if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
+ xtables_param_act(XTF_BAD_VALUE, "policy", "--reqid", optarg);
+ e->reqid = num;
break;
case '5':
if (e->match.spi)
e->match.spi = 1;
e->invert.spi = invert;
- e->spi = strtoul(argv[optind-1], NULL, 0x10);
+ if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
+ xtables_param_act(XTF_BAD_VALUE, "policy", "--spi", optarg);
+ e->spi = num;
break;
case '6':
if (e->match.saddr)
struct ipt_policy_info *info = (void *)(*match)->data;
struct ipt_policy_elem *e = &info->pol[info->len];
struct in_addr *addr = NULL, mask;
- unsigned int naddr = 0;
+ unsigned int naddr = 0, num;
int mode;
xtables_check_inverse(optarg, &invert, &optind, 0);
e->match.reqid = 1;
e->invert.reqid = invert;
- e->reqid = strtoul(argv[optind-1], NULL, 10);
+ if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
+ xtables_param_act(XTF_BAD_VALUE, "policy", "--spi", optarg);
+ e->reqid = num;
break;
case '5':
if (e->match.spi)
e->match.spi = 1;
e->invert.spi = invert;
- e->spi = strtoul(argv[optind-1], NULL, 0x10);
+ if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
+ xtables_param_act(XTF_BAD_VALUE, "policy", "--spi", optarg);
+ e->spi = num;
break;
case '6':
if (e->match.saddr)