From: Michael Tremer Date: Wed, 15 Jan 2014 15:45:44 +0000 (+0100) Subject: Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=8a7976468d6f6a14edeee5edbc54186d307815ec;hp=d99f0ff8c620a7fa832354d403cf701120273d40 Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next --- diff --git a/doc/language_issues.es b/doc/language_issues.es index 83b1d9fe7..98f1137ff 100644 --- a/doc/language_issues.es +++ b/doc/language_issues.es @@ -662,6 +662,8 @@ WARNING: untranslated string: fwdfw copy WARNING: untranslated string: fwdfw delete WARNING: untranslated string: fwdfw dnat WARNING: untranslated string: fwdfw dnat error +WARNING: untranslated string: fwdfw dnat extport +WARNING: untranslated string: fwdfw dnat nochoice WARNING: untranslated string: fwdfw dnat porterr WARNING: untranslated string: fwdfw dnat porterr2 WARNING: untranslated string: fwdfw edit diff --git a/doc/language_issues.fr b/doc/language_issues.fr index fd6e72cd0..a28120359 100644 --- a/doc/language_issues.fr +++ b/doc/language_issues.fr @@ -674,6 +674,8 @@ WARNING: untranslated string: fwdfw copy WARNING: untranslated string: fwdfw delete WARNING: untranslated string: fwdfw dnat WARNING: untranslated string: fwdfw dnat error +WARNING: untranslated string: fwdfw dnat extport +WARNING: untranslated string: fwdfw dnat nochoice WARNING: untranslated string: fwdfw dnat porterr WARNING: untranslated string: fwdfw dnat porterr2 WARNING: untranslated string: fwdfw edit diff --git a/doc/language_issues.nl b/doc/language_issues.nl index 99ab6ce6c..0ec13dc28 100644 --- a/doc/language_issues.nl +++ b/doc/language_issues.nl @@ -620,6 +620,8 @@ WARNING: untranslated string: fwdfw copy WARNING: untranslated string: fwdfw delete WARNING: untranslated string: fwdfw dnat WARNING: untranslated string: fwdfw dnat error +WARNING: untranslated string: fwdfw dnat extport +WARNING: untranslated string: fwdfw dnat nochoice WARNING: untranslated string: fwdfw dnat porterr WARNING: untranslated string: fwdfw dnat porterr2 WARNING: untranslated string: fwdfw edit diff --git a/doc/language_issues.pl b/doc/language_issues.pl index 83b1d9fe7..98f1137ff 100644 --- a/doc/language_issues.pl +++ b/doc/language_issues.pl @@ -662,6 +662,8 @@ WARNING: untranslated string: fwdfw copy WARNING: untranslated string: fwdfw delete WARNING: untranslated string: fwdfw dnat WARNING: untranslated string: fwdfw dnat error +WARNING: untranslated string: fwdfw dnat extport +WARNING: untranslated string: fwdfw dnat nochoice WARNING: untranslated string: fwdfw dnat porterr WARNING: untranslated string: fwdfw dnat porterr2 WARNING: untranslated string: fwdfw edit diff --git a/doc/language_issues.ru b/doc/language_issues.ru index 39d802deb..b4043ad6e 100644 --- a/doc/language_issues.ru +++ b/doc/language_issues.ru @@ -657,6 +657,8 @@ WARNING: untranslated string: fwdfw copy WARNING: untranslated string: fwdfw delete WARNING: untranslated string: fwdfw dnat WARNING: untranslated string: fwdfw dnat error +WARNING: untranslated string: fwdfw dnat extport +WARNING: untranslated string: fwdfw dnat nochoice WARNING: untranslated string: fwdfw dnat porterr WARNING: untranslated string: fwdfw dnat porterr2 WARNING: untranslated string: fwdfw edit diff --git a/doc/language_issues.tr b/doc/language_issues.tr index 45b129ba1..978c74f01 100644 --- a/doc/language_issues.tr +++ b/doc/language_issues.tr @@ -626,6 +626,8 @@ WARNING: untranslated string: fwdfw copy WARNING: untranslated string: fwdfw delete WARNING: untranslated string: fwdfw dnat WARNING: untranslated string: fwdfw dnat error +WARNING: untranslated string: fwdfw dnat extport +WARNING: untranslated string: fwdfw dnat nochoice WARNING: untranslated string: fwdfw dnat porterr WARNING: untranslated string: fwdfw dnat porterr2 WARNING: untranslated string: fwdfw edit diff --git a/doc/language_missings b/doc/language_missings index e37efe000..1324a4e61 100644 --- a/doc/language_missings +++ b/doc/language_missings @@ -110,6 +110,8 @@ < fwdfw delete < fwdfw dnat < fwdfw dnat error +< fwdfw dnat extport +< fwdfw dnat nochoice < fwdfw dnat porterr < fwdfw dnat porterr2 < fwdfw DROP @@ -540,6 +542,8 @@ < fwdfw delete < fwdfw dnat < fwdfw dnat error +< fwdfw dnat extport +< fwdfw dnat nochoice < fwdfw dnat porterr < fwdfw dnat porterr2 < fwdfw DROP @@ -954,6 +958,8 @@ < fwdfw delete < fwdfw dnat < fwdfw dnat error +< fwdfw dnat extport +< fwdfw dnat nochoice < fwdfw dnat porterr < fwdfw dnat porterr2 < fwdfw DROP @@ -1357,6 +1363,8 @@ < fwdfw delete < fwdfw dnat < fwdfw dnat error +< fwdfw dnat extport +< fwdfw dnat nochoice < fwdfw dnat porterr < fwdfw dnat porterr2 < fwdfw DROP diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi index 2a9415a9d..ee1303361 100644 --- a/html/cgi-bin/firewall.cgi +++ b/html/cgi-bin/firewall.cgi @@ -729,20 +729,32 @@ sub checkrule { #check valid port for NAT if($fwdfwsettings{'USE_NAT'} eq 'ON'){ - #RULE_ACTION must be on if we use NAT + #RULE_ACTION must be ACCEPT if we use NAT $fwdfwsettings{'RULE_ACTION'} = 'ACCEPT'; + #if no dnat or snat selected errormessage + if ($fwdfwsettings{'nat'} eq ''){ + $errormessage=$Lang::tr{'fwdfw dnat nochoice'}; + return; + } + + #if using snat, the external port has to be empty + if ($fwdfwsettings{'nat'} eq 'snat' && $fwdfwsettings{'dnatport'} ne ''){ + $errormessage=$Lang::tr{'fwdfw dnat extport'}; + return; + } #if no dest port is given in nat area, take target host port if($fwdfwsettings{'nat'} eq 'dnat' && $fwdfwsettings{'grp3'} eq 'TGT_PORT' && $fwdfwsettings{'dnatport'} eq ''){$fwdfwsettings{'dnatport'}=$fwdfwsettings{'TGT_PORT'};} if($fwdfwsettings{'TGT_PORT'} eq '' && $fwdfwsettings{'dnatport'} ne '' && ($fwdfwsettings{'PROT'} eq 'TCP' || $fwdfwsettings{'PROT'} eq 'UDP')){ $errormessage=$Lang::tr{'fwdfw dnat porterr2'}; + return; } #check if port given in nat area is a single valid port or portrange if($fwdfwsettings{'nat'} eq 'dnat' && $fwdfwsettings{'TGT_PORT'} ne '' && !&check_natport($fwdfwsettings{'dnatport'})){ $errormessage=$Lang::tr{'fwdfw target'}.": ".$Lang::tr{'fwdfw dnat porterr'}."
"; }elsif($fwdfwsettings{'USESRV'} eq 'ON' && $fwdfwsettings{'grp3'} eq 'cust_srv'){ my $custsrvport; - #get servcie Protocol and Port + #get service Protocol and Port foreach my $key (sort keys %customservice){ if($fwdfwsettings{$fwdfwsettings{'grp3'}} eq $customservice{$key}[0]){ if ($customservice{$key}[2] ne 'TCP' && $customservice{$key}[2] ne 'UDP'){ @@ -976,7 +988,6 @@ sub error print "$errormessage\n"; print " \n"; &Header::closebox(); - print"
"; } } sub fillselect @@ -1020,7 +1031,7 @@ sub gen_dd_block print< - +
"; } #End left table. start right table (vpn) - print"
$Lang::tr{'fwhost stdnet'}
"; + print"
"; # CCD networks if( ! -z $configccdnet || $optionsfw{'SHOWDROPDOWN'} eq 'on'){ print"
$Lang::tr{'fwhost ccdnet'} @@ -2028,7 +2037,6 @@ END -
END diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 9a5feb0b6..c93234bf3 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -933,7 +933,9 @@ 'fwdfw delete' => 'Löschen', 'fwdfw dnat' => 'Destination-NAT (Port-Weiterleitung)', 'fwdfw dnat error' => 'Für Destination-NAT muss ein einzelner Host als Ziel ausgewählt werden. Gruppen oder Netzwerke sind nicht erlaubt', -'fwdfw dnat porterr' => 'Für NAT-Regeln muss ein einzelner Port oder Portbereich angegeben werden', +'fwdfw dnat extport' => 'Bei Source-NAT-Regeln darf der externe Port nicht gesetzt sein.', +'fwdfw dnat nochoice' => 'Bitte wählen Sie Source-NAT oder Destination-NAT im NAT-Bereich aus.', +'fwdfw dnat porterr' => 'Für NAT-Regeln muss ein einzelner Port oder Portbereich angegeben werden.', 'fwdfw dnat porterr2' => 'Externer Port (NAT) darf nur angegeben werden, wenn ein Ziel-Port definiert ist.', 'fwdfw edit' => 'Bearbeiten', 'fwdfw err nosrc' => 'Keine Quelle ausgewählt', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index f68ec4cc6..67b5dd500 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -959,6 +959,8 @@ 'fwdfw delete' => 'Delete', 'fwdfw dnat' => 'Destination NAT (Port forwarding)', 'fwdfw dnat error' => 'You have to select a single host for DNAT. Groups or networks are not allowed.', +'fwdfw dnat extport' => 'The external port has to be empty when using Source NAT rules.', +'fwdfw dnat nochoice' => 'Please pick Source NAT or Destination NAT from the NAT section.', 'fwdfw dnat porterr' => 'You have to select a single port or portrange (tcp/udp) for NAT', 'fwdfw dnat porterr2' => 'Cannot use external port (NAT) when no destination port is defined.', 'fwdfw edit' => 'Edit',