Subject: Re: Logic for SNAT persistent handling introduced in 2.6.30 is inverted

From: Patrick McHardy <[email-masked]>
Date: Mon, 24 Aug 2009 19:28:37 +0200

Maximilian Engelhardt wrote:
> Kernel 2.6.30 introduced a patch [1] for the persistent option in the 
> netfilter SNAT target. This is exactly what we need here so I had a quick look 
> at the code and noticed that the patch is wrong. The logic is simply inverted.
> The patch below fixes this.

Good catch, applied. I'm wondering what the people who requested and
tested this change did actually test :)

> Also note that because of this the default behavior of the SNAT target has 
> changed since kernel 2.6.30 as it now ignores the destination IP in choosing 
> the source IP for nating (which should only be the case if the persistent 
> option is set).

It fortunately only affects NAT to a range of IPs, which isn't
used that much.