ncsid: Fix IP / Gateway updating
Sometimes phosphor-networkd incorrectly determines that DHCP should be
enabled. This prevents us from assigning IPs and gateways to the BMC.
Disable DHCP to fix assignment.
Change-Id: I91c8da79afb2ff1f1dba924f8c229ee8862bdeab
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/subprojects/ncsid/src/ncsid_lib.sh b/subprojects/ncsid/src/ncsid_lib.sh
index 86b5036..a8fca22 100644
--- a/subprojects/ncsid/src/ncsid_lib.sh
+++ b/subprojects/ncsid/src/ncsid_lib.sh
@@ -454,3 +454,14 @@
printf '{"router_ip":"%s","router_mac":"%s","stateful_address":"%s"}\n' \
"$ip" "$mac" "$staddr"
}
+
+# Sets the network configuration of an interface to be static
+SetStatic() {
+ local service="$1"
+ local netdev="$2"
+
+ echo "Disabling DHCP" >&2
+ busctl set-property "$service" "$(EthObjRoot "$netdev")" \
+ xyz.openbmc_project.Network.EthernetInterface DHCPEnabled \
+ s xyz.openbmc_project.Network.EthernetInterface.DHCPConf.none
+}