ibm-openbmc / dev

Product Development Project Mgmt and Tracking
16 stars 2 forks source link

SNMP manager is getting configured with less octate IP (Ex:10.6.6) #3606

Closed gtmills closed 1 year ago

gtmills commented 1 year ago

Internal defect is https://w3.rchland.ibm.com/projects/bestquest/?defect=SW549948 and below is copied from it.

Problem Description:

SNMP manager is getting configured with less octate IP (Ex:10.6.6)

Procedure:

1.bash-4.2$export bmc=xxxx

bash-4.2$  curl --insecure -X POST -D headers.txt https://${bmc}/redfish/v1/SessionService/Sessions -d '{"UserName":"service", "Password":"0penBmc1"}'
{
  "@odata.id": "/redfish/v1/SessionService/Sessions/m9mkdkLdpg",
  "@odata.type": "#Session.v1_3_0.Session",
  "ClientOriginIPAddress": "::ffff:9.3.84.152",
  "Description": "Manager User Session",
  "Id": "m9mkdkLdpg",
  "Name": "User Session",
  "Oem": {
    "OpenBMC": {
      "@odata.type": "#OemSession.v1_0_0.Session",
      "ClientID": ""
    }
  },
  "UserName": "service"
}
  1. Try to configure SNMP manager with invalid IP (less octate IP)
bash-4.2$ curl -k -H "X-Auth-Token: $bmc_token"  -X POST -D patch.txt  https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination": "snmp://10.66:162","SubscriptionType": "SNMPTrap", "DeliveryRetryPolicy": "TerminateAfterRetries", "Protocol": "SNMPv2c"}'
{
  "@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The resource has been created successfully",
      "MessageArgs": [],
      "MessageId": "Base.1.8.1.Created",
      "MessageSeverity": "OK",
      "Resolution": "None"
    }
  ]
}

Expectation: It should not allow to configure SNMP with less octate IP.

Please Note : Facing same issue via GUI also. Please refer to below image regarding this issue.

snmp(invalid ip)
lxwinspur commented 1 year ago

review by: https://gerrit.openbmc.org/c/openbmc/phosphor-snmp/+/55982 https://gerrit.openbmc.org/c/openbmc/phosphor-snmp/+/55983 https://gerrit.openbmc.org/c/openbmc/phosphor-snmp/+/55954

ChicagoDuan commented 1 year ago

Hi @gtmills I don't think this is a bug, because we support domain name and hostname as an address. Therefore, BMC will take the inputed address (such as 10.66 or 10.6.6) as a domain name or hostname, so it will not return an error.

gtmills commented 1 year ago

Internal defect closed. Closing this.