diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php
index 998a2ab32e..bb7ea91fe1 100644
--- a/usr/local/www/diag_packet_capture.php
+++ b/usr/local/www/diag_packet_capture.php
@@ -77,6 +77,23 @@ if ($_POST) {
$fam = $_POST['fam'];
$proto = $_POST['proto'];
+ if (!array_key_exists($interface, $interfaces)) {
+ $input_errors[] = gettext("Invalid interface.");
+ }
+ if ($fam !== "" && $fam !== "ip" && $fam !== "ip6") {
+ $input_errors[] = gettext("Invalid address family.");
+ }
+ if ($proto !== "" &&
+ $proto !== "icmp" &&
+ $proto !== "icmp6" &&
+ $proto !== "tcp" &&
+ $proto !== "udp" &&
+ $proto !== "arp" &&
+ $proto !== "carp" &&
+ $proto !== "esp") {
+ $input_errors[] = gettext("Invalid protocol.");
+ }
+
if ($host != "") {
if (!is_subnet($host) && !is_ipaddr($host)) {
$input_errors[] = sprintf(gettext("A valid IP address or CIDR block must be specified. [%s]"), $host);
@@ -178,6 +195,7 @@ include("fbegin.inc");
+
=gettext("Select the interface on which to capture traffic.");?>
@@ -243,10 +261,10 @@ include("fbegin.inc");