]> git.ipfire.org Git - thirdparty/iptables.git/commit
Kernels higher than 2.6.10 don't support multiple --to arguments in
authorPhil Oester <kernel@linuxace.com>
Mon, 19 Sep 2005 15:00:33 +0000 (15:00 +0000)
committerHarald Welte <laforge@gnumonks.org>
Mon, 19 Sep 2005 15:00:33 +0000 (15:00 +0000)
commit8cf65913bb6353bf0e92eab0669d1c4c53b43623
treeb77c8d881be4ec2a0e701e5bbd78ac6c6f0df111
parent3643aca580531eb795832feb8a83cca57f57dc0e
Kernels higher than 2.6.10 don't support multiple --to arguments in
DNAT and SNAT targets.  At present, the error is somewhat vague:

# iptables -t nat -A foo -j SNAT --to 1.2.3.4 --to 2.3.4.5
iptables: Invalid argument

But if we want current iptables to work with kernels <= 2.6.10, we
cannot simply disallow this in all cases.

So the below patch adds kernel version checking to iptables, and
utilizes it in [DS]NAT.  Now, users will see a more informative error:

# iptables -t nat -A foo -j SNAT --to 1.2.3.4 --to 2.3.4.5
iptables v1.3.3: Multiple --to-source not supported

This generic infrastructure (shamelessly lifted from procps btw) may
come in handy in the future for other changes.

This fixes bugzilla #367. (Phil Oester)
extensions/libipt_DNAT.c
extensions/libipt_SNAT.c
include/iptables.h
iptables.c