#
05d84e47
|
| 03-Sep-2025 |
Chandra Harkude <Chandramohan.harkude@gmail.com> |
Revert "ethernet: Fix premature gateway clearing on static IP validation fail"
This reverts commit 8d26c0d3a9bf14f5ad36b89db3fd3ce0d428655c.
Reason for revert: This is causing the Gateway to clear
Revert "ethernet: Fix premature gateway clearing on static IP validation fail"
This reverts commit 8d26c0d3a9bf14f5ad36b89db3fd3ce0d428655c.
Reason for revert: This is causing the Gateway to clear while assigning the static IP
Change-Id: Ie7878e3ed25c2907fdf6e7bcb7a2a26aea78a367 Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>
show more ...
|
#
8d26c0d3
|
| 06-Aug-2025 |
Chandramohan Harkude <chandramohan.harkude@gmail.com> |
ethernet: Fix premature gateway clearing on static IP validation fail
When a PATCH request contains invalid IPv4 static addresses, the gateway was being incorrectly cleared even though the static IP
ethernet: Fix premature gateway clearing on static IP validation fail
When a PATCH request contains invalid IPv4 static addresses, the gateway was being incorrectly cleared even though the static IP configuration failed validation. This occurred because HandleDHCPPatch function would clear the gateway based on the current DHCP state without validating the static addresses first. ``` Problem: - handleDHCPPatch() runs before handleIPv4StaticPatch() - If DHCP was currently active, gateway got cleared immediately - When static IP validation later failed, gateway remained cleared - This caused working DHCP configurations to lose their gateway
Example scenario: 1. System has working DHCP: IP=10.0.2.15, Gateway=10.0.2.2 2. User sends PATCH with invalid static IP: Gateway="10.3.36" 3. handleDHCPPatch() clears gateway because DHCP is currently active 4. handleIPv4StaticPatch() fails validation and returns early 5. Result: Gateway lost (shows as 0.0.0.0), network potentially broken "IPv4Addresses": [ { "Address": "10.0.2.15", "AddressOrigin": "DHCP", "Gateway": "0.0.0.0", "SubnetMask": "255.255.255.0" } ]
Solution: - Add pre-validation of IPv4 static addresses before handleDHCPPatch() - Only clear gateway when DHCP is currently active AND IPv4 static addresses are valid - This handles the implicit DHCP→Static transition correctly - Preserve existing gateway when static IP validation fails - Ensure failed requests don't have side effects on working config
Logic: - If system uses DHCP AND user provides valid static addresses: Clear DHCP gateway to prepare for clean transition to static - If static addresses are invalid: Preserve existing DHCP gateway - If system already uses static config: No gateway clearing needed
Changes: - Modified handleDHCPPatch() to accept hasValidIPv4StaticAddresses parameter - Added pre-validation step in main PATCH handler using parseAddresses() - Changed gateway clearing condition from dhcpBeingEnabled to ipv4Active - Added safety check to prevent clearing gateway on validation failures
Testing: - PATCH with invalid static IPs no longer affects working DHCP gateway - PATCH with valid static IPs on DHCP system properly clears gateway for clean transition - Mixed requests handle validation failures gracefully - Static-to-static updates work without unnecessary gateway clearing
~$ curl -k -N -X GET https://root:0penBmc@127.0.0.1:2443/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 { "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0", "@odata.type": "#EthernetInterface.v1_9_0.EthernetInterface", "DHCPv4": { "DHCPEnabled": true, "UseDNSServers": true, "UseDomainName": true, "UseNTPServers": true }, "DHCPv6": { "OperatingMode": "Enabled", "UseDNSServers": true, "UseDomainName": true, "UseNTPServers": true }, "Description": "Management Network Interface", "EthernetInterfaceType": "Physical", "FQDN": "gb200nvl-bmc", "HostName": "gb200nvl-bmc", "IPv4Addresses": [ { "Address": "10.0.2.15", "AddressOrigin": "DHCP", "Gateway": "10.0.2.2", "SubnetMask": "255.255.255.0" } ], "IPv4StaticAddresses": [], "IPv6AddressPolicyTable": [], "IPv6Addresses": [ { "Address": "fe80::86:6cff:feb4:1b3b", "AddressOrigin": "LinkLocal", "PrefixLength": 64 }, { "Address": "fec0::86:6cff:feb4:1b3b", "AddressOrigin": "DHCPv6", "PrefixLength": 64 } ], "IPv6DefaultGateway": "fe80::2", "IPv6StaticAddresses": [], "IPv6StaticDefaultGateways": [], "Id": "eth0", "InterfaceEnabled": true, "LinkStatus": "LinkUp", "MACAddress": "02:86:6c:b4:1b:3b", "MTUSize": 1500, "Name": "Manager Ethernet Interface", "NameServers": [ "10.0.2.3" ], "SpeedMbps": 100, "StatelessAddressAutoConfig": { "IPv6AutoConfigEnabled": true }, "StaticNameServers": [], "Status": { "Health": "OK", "State": "Enabled" } } ~$ curl -k -N -X PATCH https://root:0penBmc@127.0.0.1:2443/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 -H "Content-Type: application/json" -d '{"IPv4StaticAddresses": [{"Address": "10.7.7.7", "SubnetMask": "255.255.0.0", "Gateway": "10.3.36"}]}' -v < HTTP/1.1 400 Bad Request < Allow: DELETE, GET, PATCH < OData-Version: 4.0 < Strict-Transport-Security: max-age=31536000; includeSubdomains < Pragma: no-cache < Cache-Control: no-store, max-age=0 < X-Content-Type-Options: nosniff < Content-Type: application/json < Date: Wed, 06 Aug 2025 17:50:08 GMT < Content-Length: 1138 < { "IPv4StaticAddresses/0/Address@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value '\"\"' for the property IPv4StaticAddresses/0/Address is not a format that the property can accept.", "MessageArgs": [ "\"\"", "IPv4StaticAddresses/0/Address" ], "MessageId": "Base.1.19.PropertyValueFormatError", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." } ], "IPv4StaticAddresses/0/Gateway@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value '\"10.3.36\"' for the property IPv4StaticAddresses/0/Gateway is not a format that the property can accept.", "MessageArgs": [ "\"10.3.36\"", "IPv4StaticAddresses/0/Gateway" ], "MessageId": "Base.1.19.PropertyValueFormatError", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." } ] } $ curl -k -N -X GET https://root:0penBmc@127.0.0.1:2443/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 { "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0", "@odata.type": "#EthernetInterface.v1_9_0.EthernetInterface", "DHCPv4": { "DHCPEnabled": true, "UseDNSServers": true, "UseDomainName": true, "UseNTPServers": true }, "DHCPv6": { "OperatingMode": "Enabled", "UseDNSServers": true, "UseDomainName": true, "UseNTPServers": true }, "Description": "Management Network Interface", "EthernetInterfaceType": "Physical", "FQDN": "gb200nvl-bmc", "HostName": "gb200nvl-bmc", "IPv4Addresses": [ { "Address": "10.0.2.15", "AddressOrigin": "DHCP", "Gateway": "10.0.2.2", "SubnetMask": "255.255.255.0" } ], "IPv4StaticAddresses": [], "IPv6AddressPolicyTable": [], "IPv6Addresses": [ { "Address": "fe80::86:6cff:feb4:1b3b", "AddressOrigin": "LinkLocal", "PrefixLength": 64 }, { "Address": "fec0::86:6cff:feb4:1b3b", "AddressOrigin": "DHCPv6", "PrefixLength": 64 } ], "IPv6DefaultGateway": "fe80::2", "IPv6StaticAddresses": [], "IPv6StaticDefaultGateways": [], "Id": "eth0", "InterfaceEnabled": true, "LinkStatus": "LinkUp", "MACAddress": "02:86:6c:b4:1b:3b", "MTUSize": 1500, "Name": "Manager Ethernet Interface", "NameServers": [ "10.0.2.3" ], "SpeedMbps": 100, "StatelessAddressAutoConfig": { "IPv6AutoConfigEnabled": true }, "StaticNameServers": [], "Status": { "Health": "OK", "State": "Enabled" } }
```
Change-Id: Ic841344051681896bb6a0d3f8552ea9dfd92de9f Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>
show more ...
|
#
948c0b1b
|
| 24-Jul-2025 |
Ed Tanous <etanous@nvidia.com> |
Fix potential increment past end in ethernet
Coverity warns that this is a bug. GCC-15 treats it as a hard error. Incrementing past the end of an iterator is undefined behavior, so add a check to e
Fix potential increment past end in ethernet
Coverity warns that this is a bug. GCC-15 treats it as a hard error. Incrementing past the end of an iterator is undefined behavior, so add a check to ensure it never happens.
This was originally submitted as part of a larger change here: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/81720
But because this is now breaking the build, put this in its own commit.
Tested: Not great testing available for this, and Redfish array behavior is very subtle. Inspection only.
Change-Id: I15669bb7212fbd330cf1022670c9ad558ffabe73 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
177612aa
|
| 14-Feb-2025 |
Ed Tanous <etanous@nvidia.com> |
Add async_method_call to utility
Adding async_method_call in dbus utility gives us a place where we can intercept method call requests from dbus to potentially add logging/caching.
An example of lo
Add async_method_call to utility
Adding async_method_call in dbus utility gives us a place where we can intercept method call requests from dbus to potentially add logging/caching.
An example of logging is in the later commit: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/78265/
We already do this for setProperty, this moves the method calls to follow a similar pattern.
Tested: Redfish service validator passes.
Change-Id: I6d2c96e2b6b6a023ed2138106a55faebca161592 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
504af5a0
|
| 03-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <p
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
d7857201
|
| 28-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is largely just taking the clang-recommended fixes and checking them in. Subsequent patches will fix the more unique issues.
Note, that a number of new ignores are added into the .clang-tidy file. These can be cleaned up over time as they're understood. The majority are places where boost includes a impl/x.hpp and x.hpp, but expects you to use the later. include-cleaner opts for the impl, but it isn't clear why.
Change-Id: Id3fdd7ee6df6c33b2fd35626898523048dd51bfb Signed-off-by: Ed Tanous <etanous@nvidia.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
cf91c8c4
|
| 24-Jan-2025 |
Asmitha Karunanithi <asmitk01@in.ibm.com> |
Fix crash when modifying static v6 default gateway
When modifying a static default gateway, the existing entry is deleted, and a new D-Bus object is created with the updated gateway.
Currently, thi
Fix crash when modifying static v6 default gateway
When modifying a static default gateway, the existing entry is deleted, and a new D-Bus object is created with the updated gateway.
Currently, this operation fails with an Internal Server Error and causes a bmcweb crash because the gateway value is passed as a std::string_view. Debugging revealed that the data's lifetime ends before it is accessed.
This commit resolves the issue by replacing std::string_view with const std::string&.
Tested By: Assuming there are currently three IPv6StaticDefaultGateways configured, the following command modifies the second entry:
''' PATCH -D patch.txt -d '{"IPv6StaticDefaultGateways": [{},{"Address": "<new modified gateway>"},{}]}' https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth1 '''
Change-Id: I1bd18005fb71a1567b1844b04c4cc4cd322cdf6e Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
show more ...
|
#
6e78b680
|
| 13-Dec-2024 |
Asmitha Karunanithi <asmitk01@in.ibm.com> |
network: fix dhcp values in redfish response
Whenever IPv6 SLAAC is enabled and DHCPv4 is enabled, the "DHCPEnabled" value in the backend will be "v4v6stateless". Currently in bmcweb, the check to t
network: fix dhcp values in redfish response
Whenever IPv6 SLAAC is enabled and DHCPv4 is enabled, the "DHCPEnabled" value in the backend will be "v4v6stateless". Currently in bmcweb, the check to translate this value to bool for ipv4 is not present and will return false. That means, "DHCPEnabled" is wrongly displayed 'false' while the correct value is 'true'.
Change-Id: I8713d73727c6a382f06b7bf0d598ab61a757e1e3 Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
show more ...
|
#
40e9b92e
|
| 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This pa
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This patchset does not intend to modify any intent on any existing copyrights or licenses, only to standardize their inclusion.
[1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects
Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
6e1a52fa
|
| 15-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Fix setting gateways
There's a number of conditions in setting gateways that don't work properly. Specifically, one of the issues is setting a gateway on an address that already exists. It returns
Fix setting gateways
There's a number of conditions in setting gateways that don't work properly. Specifically, one of the issues is setting a gateway on an address that already exists. It returns a PropertyValueConflict error on Ipv4Addresses/1/Gateway with Ipv4Addresses/1/Gateway
Obviously an address can't conflict with itself, so this is wrong.
To address this, move the gateway setting and selection code into a routine outside of the main loop, after all the gateways are accounted for, and so we can treat them separately.
Tested; PATCH to an existing ip address works, and no longer returns the error.
More test cases likely needed.
Change-Id: I0339e02fc27164337416637153d0b0f744b64ad8 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
afc474ae
|
| 09-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Format readjson
clang-format may potentially reformat the readJson calls if they may have more keys or key names are longer. This makes formatting in a way that's readable by forcing to break a line
Format readjson
clang-format may potentially reformat the readJson calls if they may have more keys or key names are longer. This makes formatting in a way that's readable by forcing to break a line for each key using an empty-comment (`//`) each line.
It also allows trivially alphabetizing the list such that new additions are less likely to have merge conflicts.
Tested: - Check whitespace only. - Code compiles. - Redfish Service Validator with the same results before this
Change-Id: I3824a8c4faa9fa7c820d5d2fab6b565404926e2c Signed-off-by: Ed Tanous <etanous@nvidia.com> Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
#
6be832e2
|
| 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that c
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that can likely be had.
[1] https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=edtanous_bmcweb&open=AY9_HYjgKXKyw1ZFwgVP
Tested: Comment change only. Code compiles.
Change-Id: Ia960317761f558a87842347ca0b5f3da63f8e730 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
ab0d4390
|
| 03-Sep-2024 |
Ravi Teja <raviteja28031990@gmail.com> |
Fix IPv6 static default gateway
This commit updates IPv6 static default gateway implementation to use updated D-bus interfaces
PrefixLength property removed from StaticGateway D-bus interface https
Fix IPv6 static default gateway
This commit updates IPv6 static default gateway implementation to use updated D-bus interfaces
PrefixLength property removed from StaticGateway D-bus interface https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/71271
Tested by: -d '{"IPv6StaticDefaultGateways": [{"Address": "2006:905:15F:36:10:10:3:1"}]}' -d '{"IPv6StaticDefaultGateways": [{},{"Address": "2007:905:18F:36:10:9:5:1"}]}'
Change-Id: Ia90605d65652990f13c442bb21e2d796e6660587 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
show more ...
|
#
4652c640
|
| 30-Jul-2024 |
Asmitha Karunanithi <asmitk01@in.ibm.com> |
Hypervisor: Fix redfish validator errors
Currently, Redfish validator fails for displaying empty mac address when doing a GET on hypervisor ethernet interfaces.
This commit ensures that the redfish
Hypervisor: Fix redfish validator errors
Currently, Redfish validator fails for displaying empty mac address when doing a GET on hypervisor ethernet interfaces.
This commit ensures that the redfish validator passes by making the macaddress an optional property in EthernetInterfaceData structure and removing the un-implemented "MACAddress" interface check in the hypervisor GET handler method.
The following was the validator error: [1] ERROR - MACAddress: String '' does not match pattern ''^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$''
Tested By: Validator Passed.
Change-Id: Ib3f8085841093647ee97dee5602a0bb78fdd67c5 Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
show more ...
|
#
739b27b2
|
| 27-Aug-2024 |
Ravi Teja <raviteja28031990@gmail.com> |
Fix Delete IPv6StaticDefaultGateways
This commit fixes delete operation on IPv6StaticDefaultGateways
Tested by: patch with null deletes IPv6 static default gateways -d '{"IPv6StaticDefaultGateways"
Fix Delete IPv6StaticDefaultGateways
This commit fixes delete operation on IPv6StaticDefaultGateways
Tested by: patch with null deletes IPv6 static default gateways -d '{"IPv6StaticDefaultGateways": [null]}'
This change was missed in the below commit [1] https://github.com/openbmc/bmcweb/commit/ce73d5c8517e0b85d85de345f10c82c24cbb067b
Change-Id: I012ba8f7b4c1c0b78b1b758f60875708a7db6b1d Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
show more ...
|
#
bd79bce8
|
| 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
539d8c6b
|
| 19-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Consistently use generated enumerations
This commit causes all of Redfish to use generated enum values for enum types. Using generated code prevents problems, and makes it more clear what types are
Consistently use generated enumerations
This commit causes all of Redfish to use generated enum values for enum types. Using generated code prevents problems, and makes it more clear what types are allowed.
Doing this found two places where we had structs that didn't fulfill the schema. They have been commented, but will be fixed with a breaking change at some point in the future.
Tested: WIP
Change-Id: I5fdd2f2dfb6ec05606a522e1f4e331f982c8e476 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
e93abac6
|
| 14-Jun-2024 |
Ginu George <ginugeorge@ami.com> |
Pass redfishPropertyName earlier argument
It was pointed out that the setDbusProperty method should have an end that approximately matches dbus-send and busctl set-property in its arguments, to aid
Pass redfishPropertyName earlier argument
It was pointed out that the setDbusProperty method should have an end that approximately matches dbus-send and busctl set-property in its arguments, to aid with debug. This seems reasonable.
Tested: Redfish service validator passes.
Change-Id: Ic20295d93c71c957e3e76704e1eda9da187861b1 Signed-off-by: Ginu George <ginugeorge@ami.com> Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
de9ad764
|
| 03-Jun-2024 |
Ravi Teja <raviteja28031990@gmail.com> |
Populate DHCP UseDomainName with right D-bus values
Currently UseDomainName status is not updated properly as per corresponding UseDomainName D-bus value
This commit populates UseDomainName for DHC
Populate DHCP UseDomainName with right D-bus values
Currently UseDomainName status is not updated properly as per corresponding UseDomainName D-bus value
This commit populates UseDomainName for DHCPv4 and DHCPv6 parameters as per D-bus values.
Tested by: Enable/Disable DHCP UseDomainName and check values of UseDomainName
Change-Id: I6440e9ee99cf48b140f6ef7df877768117b25175 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
show more ...
|
#
4a8f5d43
|
| 24-May-2024 |
Johnathan Mantey <johnathanx.mantey@intel.com> |
Improve IPv4 default gateway removal
Removing the IPv4 default gateway doesn't work correctly when only a single static address has been assigned. This is expected to be the common mode of operation
Improve IPv4 default gateway removal
Removing the IPv4 default gateway doesn't work correctly when only a single static address has been assigned. This is expected to be the common mode of operation, and needs to work correctly.
When more than one static address is managed it's necessary to preserve the existing gateway. If any address is left unmodified, added, or is modified the gateway must be preserved.
Tested: Turned off DHCPv4, and assigned a single static address Sent a PATCH null to delete the address. Confirmed the default gateway got cleared.
Assigned two static addresses. Sent a PATCH {}, null Sent PATCH null Confirmed expected default gateway handling Assigned two static addresses. Sent a PATCH null, {} Sent PATCH null Confirmed expected default gateway handling
Change-Id: I85c4a0533f9468b424602aeb636b8f4f218a9a13 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
show more ...
|
#
253f11b8
|
| 16-May-2024 |
Ed Tanous <ed@tanous.net> |
Allow configuring "bmc" and "system"
In the early days of bmcweb, we made two pretty critical assumptions; First, is that a given platform would only have a single BMC instance (represented as "bmc"
Allow configuring "bmc" and "system"
In the early days of bmcweb, we made two pretty critical assumptions; First, is that a given platform would only have a single BMC instance (represented as "bmc") and a single host instance (represented as "system"). Second we assumed that, given that Redfish suggests against hardcoding URIs in client implementation and leaves them freeform, clients would code to the standard.
Our own webui-vue hardcodes Redfish URIs [1], and the documentation is littered with examples of hardcoded curl examples of hardcoding these URIs. That bug was filed in 2020, and the issue has only gotten worse over time.
This patchset is an attempt to give a target that we can start solving these issues, without trying to boil the ocean and fix all clients in parallel.
This commit adds the meson options redfish-manager-uri-name and redfish-system-uri-name
These are used to control the "name" that bmcweb places in the fixed locations in the ManagerCollection and ComputerSystemCollection schemas.
Note, managers is added, but is not currently testable. It will be iterated on over time.
Tested: Changed the URL options to "edsbmc" and "edssystem" in meson options.
Redfish service validator passes. URLs appear changed when walking the tree.
[1] https://github.com/openbmc/webui-vue/issues/43
Change-Id: I4b44685067051512bd065da8c2e3db68ae5ce23a Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
743eb1c0
|
| 03-Apr-2024 |
Johnathan Mantey <johnathanx.mantey@intel.com> |
Delete IPv4 default gateway when deleting an IPv4 static address
The Redfish schema for creating static IPv4 addresses requires the IP address, the netmask, and a gateway IP address. There's an issu
Delete IPv4 default gateway when deleting an IPv4 static address
The Redfish schema for creating static IPv4 addresses requires the IP address, the netmask, and a gateway IP address. There's an issue inherent with this method. A network interface is only permitted a single IPv4 default gateway. If more than one IPv4 static address is assigned to the NIC each entry is processed, and potentially conflicting default gateways may be assigned. The last entry processed assigns the IPv4 default gateway. This behavior will cause unexpected results. It is necessary to prevent assigning mismatched default gateway values.
The IPv4 address removal process requires additional work also. The default gateway value is left in place even after the final static IPv4 address is removed. It is necessary to perform an additional action to clear the gateway address. Without explicit removal the network is left in a condition that may prevent IP traffic from being able to be sent from the BMC. This even in the event that the NIC is actively being managed via DHCPv4.
Tested: Disabled DHCPv4 on a secondary NIC (eth1) Assigned a static IPv4 address. Inspected the systemd-networkd config file in order to confirm the Gateway entry is added. This is done to be explicitly sure the network.config file has the Gateway entry. Sent a Redfish PATCH command to delete the static IPv4 address. Confirmed that the systemd-networkd config file no longer contained a Gateway entry. This is done to be explicitly sure the network.config file no longer contains the Gateway entry. Created a PATCH containing multiple IPv4 static addresses all with different Gateway values. Confirmed an error is returned when a mismatch occurs in the Gateway values. Assigned a new static address, and then restored DHCPv4. Confirmed that the default gateway entry in the config file is removed. Submitted a delete request for the remaining static IPv4 address that is now orphaned by re-enabling DHCPv4. This removed the static IPv4 address.
Change-Id: Ia12cf2a38ba86266ce71dc28475b0d07b7e09ebc Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
show more ...
|
#
8cb2c024
|
| 27-Mar-2024 |
Ed Tanous <ed@tanous.net> |
Fix moves/forward
Clang has new checks for std::move/std::forward correctness, which catches quite a few "wrong" things where we were making copies of callback handlers.
Unfortunately, the lambda s
Fix moves/forward
Clang has new checks for std::move/std::forward correctness, which catches quite a few "wrong" things where we were making copies of callback handlers.
Unfortunately, the lambda syntax of
callback{std::forward<Callback>(callback)}
in a capture confuses it, so change usages to callback = std::forward<Callback>(callback)
to be consistent.
Tested: Redfish service validator passes.
Change-Id: I7a111ec00cf78ecb7d5f5b102c786c1c14d74384 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
7ac13cc9
|
| 01-Apr-2024 |
Gunnar Mills <gmills@us.ibm.com> |
Remove redfish-health-populate
The redfish-health-populate option was scheduled to be removed in 1Q 2024. It is now 2Q, so remove the option. No upstream layers enabled it and did not find a downstr
Remove redfish-health-populate
The redfish-health-populate option was scheduled to be removed in 1Q 2024. It is now 2Q, so remove the option. No upstream layers enabled it and did not find a downstream layer that did either.
This was always limited to a few resources. Overall this design was only half done. A future "HealthRollup" can be proposed.
Some discord discussion: [1]: https://discord.com/channels/775381525260664832/855566794994221117/1110728560819327069
Commit disabling this (merged 10 months ago): [2]: https://github.com/openbmc/bmcweb/commit/6f8273e49cffdd347c223b9538558edfb05e818a
Tested: Code compiles
Change-Id: I4d33c1e674ecdb0fd256df62f3795073454ae7a1 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
3dfed536
|
| 06-Mar-2024 |
Ed Tanous <ed@tanous.net> |
Clean up Ethernet to use readJson
Today, patching ethernet ip address arrays can use several styles.
IpAddresses: [{}, {value: value}, null]
All 3 of those elements are legal. Today, we unpack va
Clean up Ethernet to use readJson
Today, patching ethernet ip address arrays can use several styles.
IpAddresses: [{}, {value: value}, null]
All 3 of those elements are legal. Today, we unpack values like that with nlohmann::json, then iterate and unpack further. This leads to problems where:
IpAddresses: [{}, {value: value}, 1.0]
would have the same behavior as the prior, given that we check for "is_object()" to determine the null state. This is messy at best, and not typesafe at worst.
Changing this code to use the new class NullOr<> allows the readJson parser to fail the second example.
Change-Id: Id91f48bb64271dd568041a7c0b1ad285b59d5674 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|