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

Bug in WSS->JSON parser (parent's name appended to child's in some cases) #3

Open
Cahb opened this issue Feb 6, 2024 · 2 comments
Open

Comments

@Cahb
Copy link
Contributor

Cahb commented Feb 6, 2024

uCentral uses WSS (LEJP) callbacks to transform TCP/WSS packets from fragmented data batches into single cJSON object.
There's (presumably) a bug in the parser, as the following issue is observed:
uCentral client wrongfully parses underlying names for port-isolation:

           "downlink": {
             "downlink.interface-list": [

It's not expected for the nested name to include parent's.
This is observed only in specific scenarios, and for some reason observed only for "downlink", while "uplink" is parsed OK:
ucentral-client: proto_handle:3869: Got cmd:
...

{
  "id": 11818,
  "jsonrpc": "2.0",
  "method": "configure",
  "params": {
    "config": {
      "ethernet": [
        {
          "duplex": "full",
          "enabled": true,
          "poe": {
            "admin-mode": true
          },
          "port-isolation": {
            "sessions": [
              {
                "downlink": {
                  "downlink.interface-list": [
                    "Ethernet20"
                  ]
                },
                "id": 1,
                "uplink": {
                  "interface-list": [
                    "Ethernet20"
                  ]
                }
              }
            ]
          },
          "select-ports": [
            "Ethernet*"
          ],
          "speed": 1000
        },
        {
          "duplex": "full",
          "enabled": false,
          "poe": {
            "admin-mode": false
          },
          "select-ports": [
            "Ethernet38"
          ],
          "speed": 1000
        }
      ],
      "globals": {
        "ipv4-blackhole": [
          {
            "prefix": "192.168.67.0/24"
          }
        ]
      },
      "interfaces": [
        {
          "ethernet": [
            {
              "select-ports": [
                "Ethernet*"
              ],
              "vlan-tag": "un-tagged"
            }
          ],
          "name": "mgmt-vlan",
          "role": "upstream",
          "vlan": {
            "id": 1,
            "proto": "802.1q"
          }
        }
      ],
      "metrics": {
        "health": {
          "interval": 120
        },
        "statistics": {
          "interval": 60,
          "types": [
            "lldp",
            "clients"
          ]
        }
      },
      "switch": {
        "loop-detection": {
          "protocol": "none"
        }
      },
      "uuid": 1707239686
    },
    "serial": "e49d73b476d1",
    "uuid": 1707239686,
    "when": 0
  }
}
@Cahb
Copy link
Contributor Author

Cahb commented Feb 6, 2024

The following snippet, is a sample of port-isolation cfg pushed from cloud:

      "port-isolation": {
        "sessions": [
          {
            "id": 1,
            "uplink": {
              "interface-list": [
                "Ethernet20"
              ]
            },
            "downlink": {
              "interface-list": [
                "Ethernet21"
              ]
            }
          }
        ]
      },

@mikehansen1970
Copy link

Also note that in the full configure message, Ethernet20 is in both uplink and downlink lists, whereas the above snippet has Ethernet20 and Ethernet21 respectively. Only mentioning in case this is another unexpected behaviour/error as the snippet doesn't match the full block content under downlink, as well as having erroneous key/tag

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

No branches or pull requests

2 participants