meta-google: gbmc-iperf3: Allow for DEV builds

Change-Id: Ib2cc970201324affc212b644598ef39f4cafffbb
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/networking/gbmc-iperf3.bb b/meta-google/recipes-google/networking/gbmc-iperf3.bb
index f1a88b4..5044e41 100644
--- a/meta-google/recipes-google/networking/gbmc-iperf3.bb
+++ b/meta-google/recipes-google/networking/gbmc-iperf3.bb
@@ -12,7 +12,19 @@
 SYSTEMD_SERVICE_${PN} += "iperf3.service"
 
 do_install() {
-    # Install service definitions
-    install -d -m 0755 ${D}${systemd_system_unitdir}
-    install -m 0644 ${WORKDIR}/iperf3.service ${D}${systemd_system_unitdir}
+  # Install service definitions
+  install -d -m 0755 ${D}${systemd_system_unitdir}
+  install -m 0644 ${WORKDIR}/iperf3.service ${D}${systemd_system_unitdir}
+}
+
+# Allow IPERF3 to the mgmt node on DEV builds
+do_install_append_dev() {
+  nftables_dir=${D}${sysconfdir}/nftables
+  rules=$nftables_dir/50-gbmc-iperf3-dev.rules
+  install -d -m0755 $nftables_dir
+  echo 'table inet filter {' >"$rules"
+  echo '    chain mgmt_pub_input {' >>"$rules"
+  echo '        tcp dport 5201 accept' >>"$rules"
+  echo '    }' >>"$rules"
+  echo '}' >>"$rules"
 }