Exa-Networks / exabgp

The BGP swiss army knife of networking
Other
2.07k stars 443 forks source link

bgp-ls: Decode is incorrect #1084

Closed PabloArmingol closed 2 years ago

PabloArmingol commented 2 years ago

Couple of more issues in the json generated:

ExaBGP : master Python : 3.7.9 (default, Apr 21 2022, 10:21:52) [GCC 7.5.0] Uname : Linux exabgpspeaker 4.15.0-176-generic #185-Ubuntu SMP Tue Mar 29 17:40:04 UTC 2022 x86_64

Three issues in the json below :

The first two issues are the same as in this issue, #1082

"attribute": { 
         "origin": "igp", 
         "as-path": {"0": {"element": "as-sequence", "value": [65000]}}, 
         "bgp-ls": { 
               "generic-lsid-266": ["0x010A"], 
               "node-name": "R1", 
               "area-id": "4784128", 
               "local-te-router-ids": ["1.1.1.1"], 
               "sr_capability_flags": "sr_capability_flags": {"I": 1, "V": 0, "RSV": 0},  **<-- repeating key** 
               "sids": [(8000, 8000)],                                                                       **<-- list of tuples and range decode is not right**
               "sr-algorithms": [0, 1], 
               "generic-lsid-1036": ["0x00000003E804890003003A98"] } },

The last issue deals with the keys, having an erroneous opening and closing of the fields.

"announce": { 
        "bgp-ls bgp-ls": {
                      "10.95.86.214": [ 
                                {
                                 "ls-nlri-type": "bgpls-node", 
                                 "l3-routing-topology": 66, 
                                 "protocol-id": 2, "node-descriptors": {                    **<-- Opening error. Expected [ 
                                                  { "autonomous-system": 65000 }, 
                                                  { "bgp-ls-identifier": "101058054" }, 
                                                  { "router-id": "001001001001" } },        **<-- Closing error. Repeating }
                                                   "nexthop": "10.95.86.214"                **<-- Opening and closing error. Expected { --- }
                                    }                                                       **<-- Closing error. Expected  ]
                             }
                    ]
          }
}
thomas-mangin commented 2 years ago

If you had provided me with a full JSON object or the output of exabgp -d with the packet, I could have looked at the issue, without it, how am I to generate the same JSON as you have?

That said you must be running a version of master over a week old as I spent some time fixing the JSON code for BGP-LS last week (which I did not write, so I always love to be assigned to issue about code I am not the author of) and AFAIK this is already resolved.

"sr_capability_flags" does not exist anymore it is now "sr-capability-flags" hence why I think you should retest. Thank you.

PabloArmingol commented 2 years ago

You were right and I was updating the running version wrong. Trying again it works fine.

Thanks and sorry for the inconvenience.

thomas-mangin commented 2 years ago

Great to hear - no worries at all, it is just hard to help people when you do not have data to reproduce issues reported.

Have a good weekend.