File: accept-options-allowed-by-any-given-command.patch

package info (click to toggle)
iptables 1.8.11-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,792 kB
  • sloc: ansic: 53,482; sh: 7,810; xml: 772; python: 755; makefile: 271
file content (20 lines) | stat: -rw-r--r-- 795 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Author: Phil Sutter <phil@nwl.cc>
Last-Update: 2025-11-15
Forwarded: not-needed
Applied-Upstream: commit:192c3a6bc18f206895ec5e38812d648ccfe7e281
Description: Accept an option if any given command allows it
 Fixed commit made option checking overly strict: Some commands may be
 commbined (foremost --list and --zero), reject a given option only if it
 is not allowed by any of the given commands.

--- a/iptables/xshared.c
+++ b/iptables/xshared.c
@@ -980,7 +980,7 @@
 	 */
 	for (i = 0, optval = 1; i < NUMBER_OF_OPT; optval = (1 << ++i)) {
 		if ((options & optval) &&
-		    (options_v_commands[i] & command) != command)
+		    !(options_v_commands[i] & command))
 			xtables_error(PARAMETER_PROBLEM,
 				      "Illegal option `%s' with this command",
 				      ops->option_name(optval));