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

Unpredictable behavior in dhcpoption resource #35

Open
miguelagd opened this issue Jul 25, 2017 · 4 comments
Open

Unpredictable behavior in dhcpoption resource #35

miguelagd opened this issue Jul 25, 2017 · 4 comments
Assignees

Comments

@miguelagd
Copy link

Following the documentation, if actualType and actualValues are defined, in a dhcpoption, they override the values of type and value, respectively. However, in a modification (PUT) of a dhcpoption, when both actualType and actualValues are explicitly defined (with no null values) sometimes they are taking into account, modifying the dhcpoption using them, but sometimes they are ignored, using the values of type and value instead.

Please, find below a concrete sequence of steps that reproduce the issue:

  1. Create a dhcpoption--> OK.

Json sent:

{
    "actualType": 6,
    "actualValues": ["8.8.8.8" ,"1.1.1.1"],
    "length": null,
    "type": null,
    "value": null
}

Json received:

[{
   "children": null,
   "parentType": "subnet",
   "entityScope": "ENTERPRISE",
   "lastUpdatedBy": "8a6f0e20-a4db-4878-ad84-9cc61756cd5e",
   "lastUpdatedDate": 1500975979000,
   "creationDate": 1500975979000,
   "type": "06",
   "length": "08",
   "value": "0808080801010101",
   "actualValues":    [
      "8.8.8.8",
      "1.1.1.1"
   ],
   "actualType": 6,
   "owner": "8a6f0e20-a4db-4878-ad84-9cc61756cd5e",
   "ID": "cf053e41-1c1f-4dd8-b1ea-bd4a5a88f4ec",
   "parentID": "d21961d1-a43f-43a9-915b-02d07cda98de",
   "externalID": null
}]
  1. Update the dhcpoption: --> OK.

Json sent:

{
    "actualType": 6,
    "actualValues": ["8.8.8.8" ,"1.1.1.5"],
    "length": "08",
    "type": "06",
    "value": "0808080801010101"
}

Json received after a read of the dhcpoption:

[{
   "children": null,
   "parentType": "subnet",
   "entityScope": "ENTERPRISE",
   "lastUpdatedBy": "8a6f0e20-a4db-4878-ad84-9cc61756cd5e",
   "lastUpdatedDate": 1500976666000,
   "creationDate": 1500976592000,
   "type": "06",
   "length": "08",
   "value": "0808080801010102",
   "actualValues":    [
      "8.8.8.8",
      "1.1.1.2"
   ],
   "actualType": 6,
   "owner": "8a6f0e20-a4db-4878-ad84-9cc61756cd5e",
   "ID": "0ba86451-be88-4821-8782-d5541f2ddff3",
   "parentID": "d21961d1-a43f-43a9-915b-02d07cda98de",
   "externalID": null
}]
  1. Update the dhcpoption again --> fails -->actualValues is ignored, going back to the original value, contained in value:

Json sent:

{
    "actualType": 6,
    "actualValues": ["8.8.8.8" ,"1.1.1.3"],
    "length": "08",
    "type": "06",
    "value": "0808080801010101"
}

Json received after a read of the dhcpoption:

[{
   "children": null,
   "parentType": "subnet",
   "entityScope": "ENTERPRISE",
   "lastUpdatedBy": "8a6f0e20-a4db-4878-ad84-9cc61756cd5e",
   "lastUpdatedDate": 1500976804000,
   "creationDate": 1500976592000,
   "type": "06",
   "length": "08",
   "value": "0808080801010101",
   "actualValues":    [
      "8.8.8.8",
      "1.1.1.1"
   ],
   "actualType": 6,
   "owner": "8a6f0e20-a4db-4878-ad84-9cc61756cd5e",
   "ID": "0ba86451-be88-4821-8782-d5541f2ddff3",
   "parentID": "d21961d1-a43f-43a9-915b-02d07cda98de",
   "externalID": null
}]
  1. Additional updates behave alternatively like steps 2. and 3.

This behavior has been found in 4.0 R4 and 4.0 R7.

@pdellaert
Copy link
Member

@miguelagd have you tried sending type and value as null during your PUT commands and just have the actualType and actualValue set?

@pdellaert
Copy link
Member

@miguelagd any feedback, otherwise i'm going to close this...

@miguelagd
Copy link
Author

Sorry. For any reason I did not read the comment you wrote on July. I will test it today, during the day, and I will give you an answer.

Thanks.

@miguelagd miguelagd changed the title Umpredictable behavior in dhcpoption resource Unpredictable behavior in dhcpoption resource Nov 2, 2017
@miguelagd
Copy link
Author

@miguelagd have you tried sending type and value as null during your PUT commands and just have the actualType and actualValue set?

I have tried what you proposed without success: Nuage's VSD returns an error if value is null. Let me give you a complete example of what I tested:

  1. Creating a DHCP option:
  • JSON sent:
{
    "actualType": 6,
    "actualValues": ["8.8.8.8" ,"1.1.1.1"],
    "length": null,
    "type": null,
    "value": null
}
  • JSON received:
[{
   "children": null,
   "parentType": "subnet",
   "entityScope": "ENTERPRISE",
   "lastUpdatedBy": "8a6f0e20-a4db-4878-ad84-9cc61756cd5e",
   "lastUpdatedDate": 1509979009000,
   "creationDate": 1509979009000,
   "type": "06",
   "length": "08",
   "value": "0808080801010101",
   "actualValues":    [
      "8.8.8.8",
      "1.1.1.1"
   ],
   "actualType": 6,
   "owner": "8a6f0e20-a4db-4878-ad84-9cc61756cd5e",
   "ID": "b14566a8-1bfc-4679-9c96-d75151bf21b5",
   "parentID": "30119341-9373-47d5-b6c6-f192e8dfe376",
   "externalID": null
}]
  1. Updating the IP:
  • JSON sent:
{
    "actualType": 6,
    "actualValues": ["8.8.8.8" ,"1.1.1.2"],
    "length": "08",
    "type": null,
    "value": null
}
  • JSON received:
{
   "errors":    [
            {
         "property": "value",
         "descriptions": [         {
            "title": "Invalid hexadecimal number",
            "description": "Value must be a valid padded (multiple of 2) hexadecimal number."
         }]
      },
            {
         "property": "type",
         "descriptions": [         {
            "title": "Invalid hexadecimal number",
            "description": "Value must be a valid padded (multiple of 2) hexadecimal number."
         }]
      }
   ],
   "internalErrorCode": 5000
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants