From 8afd8c0409a9ed246a244e7a1dbdcb2ad627434b Mon Sep 17 00:00:00 2001 From: stilez Date: Tue, 27 Dec 2016 01:31:14 +0000 Subject: Alternate fix for jim-p's point that seems to resolve everything neatly @jim-p commented on the PR that: > This change is unwarranted. The protocol default should remain TCP, it is set that way on purpose (otherwise people get confused by the lack of port options being visible). It's also not relevant to the other changes being made on this PR. An alternate fix for jim-p's point. this only affects creating new rules and I take the point. I found this a much better fix (AFAICS). It seems to resolve all issues neatly. Proposed fix: leave "any" at the top of the list as that's the logical place people almost always look for it if they want it, _but set the default proto to tcp for new rules_ so that ports and other expected items are displayed by default too. After all, the default protocol is only relevant for showing tcp and ports fields, when a new blank rule is created (obvious: if the rule exists it would display the protocol in the existing rule). @jim-p can you try this as a fix, and see if it would be acceptable for resolving your point? --- src/usr/local/www/firewall_rules_edit.php | 1 + 1 file changed, 1 insertion(+) (limited to 'src/usr/local/www/firewall_rules_edit.php') diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index e6f296a..79b3fb0 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -296,6 +296,7 @@ if (isset($id) && $a_filter[$id]) { $pconfig['interface'] = $_GET['if']; } $pconfig['type'] = "pass"; + $pconfig['proto'] = "tcp"; // ensures port fields visible and default=tcp, for a new rule $pconfig['src'] = "any"; $pconfig['dst'] = "any"; } -- cgit v1.1