mirror of
https://gitlab.com/shorewall/code.git
synced 2025-02-16 17:51:16 +01:00
Correct detection of IPv6 PERSISTENT_SNAT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
6035d49ede
commit
82f9ba8bb7
@ -2225,6 +2225,8 @@ determine_capabilities() {
|
||||
if qt $g_tool -t nat -N $chain; then
|
||||
if [ $g_family -eq 4 ]; then
|
||||
qt $g_tool -t nat -A $chain -j SNAT --to-source 1.2.3.4 --persistent && PERSISTENT_SNAT=Yes
|
||||
else
|
||||
qt $g_tool -t nat -A $chain -j SNAT --to-source 2001::1 --persistent && PERSISTENT_SNAT=Yes
|
||||
fi
|
||||
qt $g_tool -t nat -F $chain
|
||||
qt $g_tool -t nat -X $chain
|
||||
|
@ -3549,9 +3549,10 @@ sub Persistent_Snat() {
|
||||
have_capability( 'NAT_ENABLED' ) || return '';
|
||||
|
||||
my $result = '';
|
||||
my $address = $family == F_IPV4 ? '1.2.3.4' : '2001::1';
|
||||
|
||||
if ( qt1( "$iptables -t nat -N $sillyname" ) ) {
|
||||
$result = qt1( "$iptables -t nat -A $sillyname -j SNAT --to-source 1.2.3.4 --persistent" );
|
||||
$result = qt1( "$iptables -t nat -A $sillyname -j SNAT --to-source $address --persistent" );
|
||||
qt1( "$iptables -t nat -F $sillyname" );
|
||||
qt1( "$iptables -t nat -X $sillyname" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user