if (e->match.spi)
exit_error(PARAMETER_PROBLEM,
"policy match: double --spi option");
-
+
e->match.spi = 1;
e->invert.spi = invert;
e->spi = strtol(argv[optind-1], NULL, 0x10);
if (e->match.mode)
exit_error(PARAMETER_PROBLEM,
"policy match: double --mode option");
-
+
mode = parse_mode(argv[optind-1]);
e->match.mode = 1;
e->invert.mode = invert;
exit_error(PARAMETER_PROBLEM,
"policy match: can't invert --next option");
+ if (!(e->match.reqid || e->match.spi || e->match.saddr ||
+ e->match.daddr || e->match.proto || e->match.mode))
+ exit_error(PARAMETER_PROBLEM,
+ "policy match: --next without policy element specification");
+
if (++info->len == IP6T_POLICY_MAX_ELEM)
exit_error(PARAMETER_PROBLEM,
"policy match: maximum policy depth reached");
if (e->match.spi)
exit_error(PARAMETER_PROBLEM,
"policy match: double --spi option");
-
+
e->match.spi = 1;
e->invert.spi = invert;
e->spi = strtol(argv[optind-1], NULL, 0x10);
if (e->match.mode)
exit_error(PARAMETER_PROBLEM,
"policy match: double --mode option");
-
+
mode = parse_mode(argv[optind-1]);
e->match.mode = 1;
e->invert.mode = invert;
exit_error(PARAMETER_PROBLEM,
"policy match: can't invert --next option");
+ if (!(e->match.reqid || e->match.spi || e->match.saddr ||
+ e->match.daddr || e->match.proto || e->match.mode))
+ exit_error(PARAMETER_PROBLEM,
+ "policy match: --next without policy element specification");
+
if (++info->len == IPT_POLICY_MAX_ELEM)
exit_error(PARAMETER_PROBLEM,
"policy match: maximum policy depth reached");