Project

General

Profile

« Previous | Next » 

Revision ff6e6929

Added by Phil Davis almost 12 years ago

Relax advanced options firewall rules tests

Various advanced options are now possible for any protocol since https://github.com/pfsense/pfsense/commit/653bde345e8f960de5bc745fe74e64d8ef3fd2d3
So allow these through the front-end GUI validation also.
Code change for 2.1 branch.

View differences:

usr/local/www/firewall_rules_edit.php
481 481
			$input_errors[] = gettext("You can only specify the state timeout (advanced option) for TCP protocol.");
482 482
	}
483 483

  
484
	if (!in_array($_POST['proto'], array("icmp","udp","tcp","tcp/udp"))) {
485
		if (!empty($_POST['max']))
486
			$input_errors[] = gettext("You can only specify the maximum state entries (advanced option) for ICMP/TCP/UDP protocols.");
487
		if (!empty($_POST['max-src-nodes']))
488
			$input_errors[] = gettext("You can only specify the maximum number of unique source hosts (advanced option) for ICMP/TCP/UDP protocols.");
489
		if (!empty($_POST['max-src-states']))
490
			$input_errors[] = gettext("You can only specify the maximum state entries per host (advanced option) for ICMP/TCP/UDP protocols.");
491
	}
492

  
493 484
	if ($_POST['type'] <> "pass") {
494 485
		if (!empty($_POST['max']))
495 486
			$input_errors[] = gettext("You can only specify the maximum state entries (advanced option) for Pass type rules.");
......
1255 1246
				<input name="tagged" id="tagged" value="<?=htmlspecialchars($pconfig['tagged']);?>" />
1256 1247
				<br /><span class="vexpl"><?=gettext("You can match packet on a mark placed before on another rule.")?>
1257 1248
				</span></p><p>
1258
				<input name="max" id="max" value="<?php echo htmlspecialchars($pconfig['max']) ?>" /><br/><?=gettext(" Maximum state entries this rule can create (TCP/UDP/ICMP)");?></p><p>
1259
				<input name="max-src-nodes" id="max-src-nodes" value="<?php echo htmlspecialchars($pconfig['max-src-nodes']) ?>" /><br/><?=gettext(" Maximum number of unique source hosts (TCP/UDP/ICMP)");?></p><p>
1249
				<input name="max" id="max" value="<?php echo htmlspecialchars($pconfig['max']) ?>" /><br/><?=gettext(" Maximum state entries this rule can create");?></p><p>
1250
				<input name="max-src-nodes" id="max-src-nodes" value="<?php echo htmlspecialchars($pconfig['max-src-nodes']) ?>" /><br/><?=gettext(" Maximum number of unique source hosts");?></p><p>
1260 1251
				<input name="max-src-conn" id="max-src-conn" value="<?php echo htmlspecialchars($pconfig['max-src-conn']) ?>" /><br/><?=gettext(" Maximum number of established connections per host (TCP only)");?></p><p>
1261
				<input name="max-src-states" id="max-src-states" value="<?php echo htmlspecialchars($pconfig['max-src-states']) ?>" /><br/><?=gettext(" Maximum state entries per host (TCP/UDP/ICMP)");?></p><p>
1252
				<input name="max-src-states" id="max-src-states" value="<?php echo htmlspecialchars($pconfig['max-src-states']) ?>" /><br/><?=gettext(" Maximum state entries per host");?></p><p>
1262 1253
				<input name="max-src-conn-rate" id="max-src-conn-rate" value="<?php echo htmlspecialchars($pconfig['max-src-conn-rate']) ?>" /> /
1263 1254
				<select name="max-src-conn-rates" id="max-src-conn-rates">
1264 1255
					<option value=""<?php if(intval($pconfig['max-src-conn-rates']) < 1) echo " selected=\"selected\""; ?>></option>

Also available in: Unified diff