Is this the right place to submit this?
Bug Description
I'm testing on bmcweb revision : 4d7b5dd (Commits on Mar 14, 2025).
I tried to use Redfish command to set a static IPv4 address and defaultGateway. After that, I saw the defaultGateway is empty.
Step to reproduce:
Step 1: Check the defaultGateway is valid and DHCP v4 mode is Enable
root@board:~# busctl introspect xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface - - -
.Introspect method - s -
org.freedesktop.DBus.Peer interface - - -
.GetMachineId method - s -
.Ping method - - -
org.freedesktop.DBus.Properties interface - - -
.Get method ss v -
.GetAll method s a{sv} -
.Set method ssv - -
.PropertiesChanged signal sa{sv}as - -
xyz.openbmc_project.Collection.DeleteAll interface - - -
.DeleteAll method - - -
xyz.openbmc_project.Network.EthernetInterface interface - - -
.AutoNeg property b true emits-change
.DHCP4 property b true emits-change writable
.DHCP6 property b true emits-change writable
.DHCPEnabled property s "xyz.openbmc_project.Network.Ethernet... emits-change writable
.DefaultGateway property s "10.39.122.1" emits-change writable
.DefaultGateway6 property s "" emits-change writable
.DomainName property as 0 emits-change writable
.EmitLLDP property b false emits-change writable
.IPv6AcceptRA property b true emits-change writable
.InterfaceName property s "eth0" const
.LinkLocalAutoConf property s "xyz.openbmc_project.Network.Ethernet... emits-change writable
.LinkUp property b true emits-change
.MTU property u 1500 emits-change writable
.NICEnabled property b true emits-change writable
.NTPServers property as 0 emits-change writable
.Nameservers property as 3 "10.38.20.10" "10.38.18.70" "10.38.... emits-change
.Speed property u 1000 emits-change
.StaticNTPServers property as 0 emits-change writable
.StaticNameServers property as 0 emits-change writable
xyz.openbmc_project.Network.IP.Create interface - - -
.IP method ssys o -
xyz.openbmc_project.Network.MACAddress interface - - -
.MACAddress property s "9c:c2:66:77:88:99" emits-change writable
xyz.openbmc_project.Network.Neighbor.CreateStatic interface - - -
.Neighbor method ss o -
xyz.openbmc_project.Network.StaticGateway.Create interface - - -
.StaticGateway
Step 2: Add a staic IPv4 address by redfish command with IPv4 address and defaultGateway is valid.
curl -X PATCH --user root:0penBmc -H "Content-Type: application/json" -H "If-match: *" --insecure https://${BMC_IP}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 -d '{"IPv4StaticAddresses": [{"Address": "10.39.122.50", "Gateway": "10.39.122.1", "SubnetMask": "255.255.255.0"}]}'
Step 3: Check the defaultGateway
=> The defaultGateway is empty
root@board:~# busctl introspect xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface - - -
.Introspect method - s -
org.freedesktop.DBus.Peer interface - - -
.GetMachineId method - s -
.Ping method - - -
org.freedesktop.DBus.Properties interface - - -
.Get method ss v -
.GetAll method s a{sv} -
.Set method ssv - -
.PropertiesChanged signal sa{sv}as - -
xyz.openbmc_project.Collection.DeleteAll interface - - -
.DeleteAll method - - -
xyz.openbmc_project.Network.EthernetInterface interface - - -
.AutoNeg property b true emits-change
.DHCP4 property b true emits-change writable
.DHCP6 property b true emits-change writable
.DHCPEnabled property s "xyz.openbmc_project.Network.Ethernet... emits-change writable
.DefaultGateway property s "" emits-change writable
.DefaultGateway6 property s "" emits-change writable
.DomainName property as 0 emits-change writable
.EmitLLDP property b false emits-change writable
.IPv6AcceptRA property b true emits-change writable
.InterfaceName property s "eth0" const
.LinkLocalAutoConf property s "xyz.openbmc_project.Network.Ethernet... emits-change writable
.LinkUp property b true emits-change
.MTU property u 1500 emits-change writable
.NICEnabled property b true emits-change writable
.NTPServers property as 0 emits-change writable
.Nameservers property as 3 "10.38.20.10" "10.38.18.70" "10.38.... emits-change
.Speed property u 1000 emits-change
.StaticNTPServers property as 0 emits-change writable
.StaticNameServers property as 0 emits-change writable
xyz.openbmc_project.Network.IP.Create interface - - -
.IP method ssys o -
xyz.openbmc_project.Network.MACAddress interface - - -
.MACAddress property s "9c:c2:66:77:88:99" emits-change writable
xyz.openbmc_project.Network.Neighbor.CreateStatic interface - - -
.Neighbor method ss o -
xyz.openbmc_project.Network.StaticGateway.Create interface - - -
.StaticGateway method ss o -
Version
I'm testing on bmcweb revision : 4d7b5dd (Commits on Mar 14, 2025).
Additional Information
Other observations, I checked the source code of the bmcweb. It seems when we patch a redfish command to update IPv4StaticAddresses then the handleDHCPPatch also is called before https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/ethernet.hpp#L2416
That makes the defaultGateway is removed in the handleDHCPPatch.
But in handleIPv4StaticPatch function, the defaultGateway can not be added again because the ethData.defaultGateway can be not updated after the handleDHCPPatch removed the defaultGateway.
Is this the right place to submit this?
Bug Description
I'm testing on bmcweb revision : 4d7b5dd (Commits on Mar 14, 2025).
I tried to use Redfish command to set a static IPv4 address and defaultGateway. After that, I saw the defaultGateway is empty.
Step to reproduce:
Step 1: Check the defaultGateway is valid and DHCP v4 mode is Enable
Step 2: Add a staic IPv4 address by redfish command with IPv4 address and defaultGateway is valid.
Step 3: Check the defaultGateway
=> The defaultGateway is empty
Version
Additional Information
Other observations, I checked the source code of the bmcweb. It seems when we patch a redfish command to update
IPv4StaticAddressesthen thehandleDHCPPatchalso is called before https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/ethernet.hpp#L2416That makes the
defaultGatewayis removed in thehandleDHCPPatch.But in
handleIPv4StaticPatchfunction, thedefaultGatewaycan not be added again because theethData.defaultGatewaycan be not updated after thehandleDHCPPatchremoved thedefaultGateway.