Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPAddresses have field's value 0.0.0.0 #269

Closed
4 tasks done
hieuhuynh-ampere opened this issue Dec 28, 2023 · 10 comments
Closed
4 tasks done

IPAddresses have field's value 0.0.0.0 #269

hieuhuynh-ampere opened this issue Dec 28, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@hieuhuynh-ampere
Copy link

Is this the right place to submit this?

  • This is not a security vulnerability or a crashing bug
  • This is not a question about how to use OpenBMC
  • This is not a bug in an OpenBMC fork or a bug in code still under code review.
  • This is not a request for a new feature.

Bug Description

Run Redfish GET

  • curl -X GET --user root:0penBmc -H "Content-Type: application/json" --insecure https://bmc_ip/redfish/v1/Managers/bmc/EthernetInterfaces/eth1
"IPv4Addresses": [
{
"Gateway": "0.0.0.0",
}
],
  • curl -X GET --user root:0penBmc -H "Content-Type: application/json" --insecure https://bmc_ip/redfish/v1/Managers/bmc/EthernetInterfaces/usb0
"IPv4Addresses": [
{
"Gateway": "0.0.0.0",
}
],
"IPv4StaticAddresses": [
{
"Gateway": "0.0.0.0",
}
],

Expected result:

If there is no data setting for IP addresses/gateways, the value should be null.

Actual result:

Value display 0.0.0.0 is a wrong and meaningless IP

This make test of Redfish-Usecase-Compliance NetworkManager failed https://github.com/DMTF/Redfish-Usecase-Checkers

$ python3 manager_ethernet_interface/manager_ethernet_interface_check.py -r bmc_ip:443 -u root -p 0penBmc -S Always
Found 1 manager instances
Found 3 Ethernet interface instances in manager 'bmc'
Testing interface 'eth0'
Testing interface 'eth1'
ERROR: 'IPv4Addresses' contains an empty string, 0.0.0.0, or :: rather than null in manager 'bmc' interface 'eth1'
Testing interface 'usb0'
ERROR: 'IPv4Addresses' contains an empty string, 0.0.0.0, or :: rather than null in manager 'bmc' interface 'usb0'
ERROR: 'IPv4StaticAddresses' contains an empty string, 0.0.0.0, or :: rather than null in manager 'bmc' interface 'usb0'

Version

Openbmc SHA1: 0bb38d152cd28e699f21cf6d240f1f9ba886be5e
Platform: mtmitchell-dcscm

Additional Information

bmcweb set the default Gateway to '0.0.0.0' is this value is empty https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/ethernet.hpp#L1660

@edtanous edtanous changed the title [RedfishCompliance] IPAddresses have field's value 0.0.0.0 IPAddresses have field's value 0.0.0.0 Dec 28, 2023
@edtanous edtanous added the bug Something isn't working label Dec 28, 2023
@gtmills
Copy link
Member

gtmills commented Mar 5, 2024

What should bmcweb do instead? Just leave the property off?

@edtanous
Copy link
Contributor

edtanous commented Mar 5, 2024

the value should be null.

From the description.

@hieuhuynh-ampere
Copy link
Author

Hi @edtanous, could I have a MR to update these fields to null?

@gtmills
Copy link
Member

gtmills commented Mar 5, 2024

Hi @edtanous, could I have a MR to update these fields to null?"

Feel free to push something to https://gerrit.openbmc.org/q/project:openbmc/bmcweb+status:open

Be sure to follow our documentation https://github.com/openbmc/bmcweb/blob/master/DEVELOPING.md

bradbishop pushed a commit that referenced this issue Mar 6, 2024
bmcweb set the default value of IPAddress/Gateway of
Managers/bmc/EthernetInterfaces/<id> to "0.0.0.0"
if these values are empty. The value display "0.0.0.0" is wrong and
meaningless IP; this should be null.
This updates these value to "null".

Fixes: #269

Tested: Redfish-Usecase-Checkers passed.
python3 manager_ethernet_interface/ \
manager_ethernet_interface_check.py -r ${BMC_IP}:443 -u root -p \
0penBmc -S Always

Found 1 manager instances
Found 3 Ethernet interface instances in manager 'bmc'
Testing interface 'eth0'
Testing interface 'eth1'
Testing interface 'usb0'

Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: I8278a8e14c39ce26ff393fbbd3b8993ea2c5e6a1
@edtanous
Copy link
Contributor

edtanous commented Mar 7, 2024

Hi @edtanous, could I have a MR to update these fields to null?

What is an MR?

@hieuhuynh-ampere
Copy link
Author

Hi @edtanous,

What is an MR?

From this: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/69864

@edtanous
Copy link
Contributor

edtanous commented Mar 8, 2024

What does "MR" mean?

@hieuhuynh-ampere
Copy link
Author

I mean a Gerrit review.

bradbishop pushed a commit that referenced this issue Mar 8, 2024
bmcweb set the default value of IPAddress/Gateway of
Managers/bmc/EthernetInterfaces/<id> to "0.0.0.0"
if these values are empty. The value display "0.0.0.0" is wrong and
meaningless IP; this should be null.
This updates these value to "null".

Fixes: #269

Tested: Redfish-Usecase-Checkers passed.
python3 manager_ethernet_interface/ \
manager_ethernet_interface_check.py -r ${BMC_IP}:443 -u root -p \
0penBmc -S Always

Found 1 manager instances
Found 3 Ethernet interface instances in manager 'bmc'
Testing interface 'eth0'
Testing interface 'eth1'
Testing interface 'usb0'

Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: I8278a8e14c39ce26ff393fbbd3b8993ea2c5e6a1
bradbishop pushed a commit that referenced this issue Mar 8, 2024
bmcweb set the default value of IPAddress/Gateway of
Managers/bmc/EthernetInterfaces/<id> to "0.0.0.0"
if these values are empty. The value display "0.0.0.0" is wrong and
meaningless IP; this should be null.
This updates these value to "null".

Fixes: #269

Tested: Redfish-Usecase-Checkers passed.
python3 manager_ethernet_interface/ \
manager_ethernet_interface_check.py -r ${BMC_IP}:443 -u root -p \
0penBmc -S Always

Found 1 manager instances
Found 3 Ethernet interface instances in manager 'bmc'
Testing interface 'eth0'
Testing interface 'eth1'
Testing interface 'usb0'

Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: I8278a8e14c39ce26ff393fbbd3b8993ea2c5e6a1
bradbishop pushed a commit that referenced this issue Mar 8, 2024
bmcweb set the default value of IPAddress/Gateway of
Managers/bmc/EthernetInterfaces/<id> to "0.0.0.0" if these values are
empty. The value display "0.0.0.0" is wrong and meaningless IP; This
should be null.

This commit updates these values to null.

Fixes: #269

Tested: Redfish-Usecase-Checkers passed.
python3 manager_ethernet_interface/ \
manager_ethernet_interface_check.py -r ${BMC_IP}:443 -u root -p \
0penBmc -S Always

Found 1 manager instances
Found 3 Ethernet interface instances in manager 'bmc'
Testing interface 'eth0'
Testing interface 'eth1'
Testing interface 'usb0'

Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: I8278a8e14c39ce26ff393fbbd3b8993ea2c5e6a1
bradbishop pushed a commit that referenced this issue Mar 8, 2024
bmcweb set the default value of IPAddress/Gateway of
Managers/bmc/EthernetInterfaces/<id> to "0.0.0.0" if these values are
empty. The value display "0.0.0.0" is wrong and meaningless IP; This
should be null.

This commit updates these values to null.

Fixes #269

Tested: Redfish-Usecase-Checkers passed.
python3 manager_ethernet_interface/ \
manager_ethernet_interface_check.py -r ${BMC_IP}:443 -u root -p \
0penBmc -S Always

Found 1 manager instances
Found 3 Ethernet interface instances in manager 'bmc'
Testing interface 'eth0'
Testing interface 'eth1'
Testing interface 'usb0'

Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: I8278a8e14c39ce26ff393fbbd3b8993ea2c5e6a1
@edtanous
Copy link
Contributor

edtanous commented Jul 2, 2024

It looks like we may have been doing this correctly. I filed an issue with DMTF, and they are going to amend the wording to specifically call out the unconfigured case for ipv6 and ipv4

@edtanous
Copy link
Contributor

Closing, per discussion in DMTF, this behavior of using 0.0.0.0 for unset ipv4 addresses seems to be correct (even if not explicitly defined in the spec). Redfish usecase checker seems to be in the wrong here. Feel free to file a bug against it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants