1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-04-26 01:38:32 +00:00
thatmattlove-hyperglass/hyperglass/models
Tan Siewert 32873934cf
frr: set default values for optional next-hop fields
The metric and used fields might not be returned, causing the parser to
fail if they are not present. The absence was observed in FRR 10.4.1
with a multipath IPv6 route that has two next-hops (one GUA, one LL):
```
$ vtysh -c "show bgp ipv6 unicast 2003::/19 json" | jq '.paths[].nexthops'
[
  {
    "ip": "2a0d:2146:bdff:120::1",
    "afi": "ipv6",
    "scope": "global",
    "linkLocalOnly": false,
    "length": 32,
    "metric": 0,
    "accessible": true
  },
  {
    "ip": "fe80::3e61:408:1e3e:cff0",
    "afi": "ipv6",
    "scope": "link-local",
    "length": 32,
    "accessible": true,
    "used": true
  }
]
[
  {
    "ip": "2a0d:2146:bdff:120::1",
    "afi": "ipv6",
    "scope": "global",
    "linkLocalOnly": false,
    "length": 32,
    "metric": 0,
    "accessible": true
  },
  {
    "ip": "fe80::3e61:408:1e3e:cff0",
    "afi": "ipv6",
    "scope": "link-local",
    "length": 32,
    "accessible": true,
    "used": true
  }
]
```

Tested: Query a prefix with multiple next-hops where the metric or used
attributes are missing on one of them.

Signed-off-by: Tan Siewert <tan@siewert.io>
2025-10-04 21:35:27 +02:00
..
api Merge branch 'main' into computroniks/bug/#311-fix-field-validation 2025-09-27 20:58:59 -04:00
config Merge branch 'main' into computroniks/bug/#311-fix-field-validation 2025-09-27 20:58:59 -04:00
data format and lint 2025-06-14 21:44:20 -04:00
parsing frr: set default values for optional next-hop fields 2025-10-04 21:35:27 +02:00
tests format and lint 2025-06-14 21:44:20 -04:00
__init__.py Improve MultiModel API 2021-09-18 09:51:47 -07:00
directive.py Fix bug: Directives will be error on deserialize rules and field with None type 2025-09-25 23:17:21 -04:00
fields.py upgrade major dependencies 2024-03-16 23:17:54 -04:00
main.py fix prepending of HYPERGLASS_APP_PATH to values; closes #253 2024-06-01 15:08:59 -04:00
system.py fix container file handling 2024-05-27 16:08:50 -04:00
ui.py Fix bug: Directives will be error on deserialize rules and field with None type 2025-09-25 23:17:21 -04:00
util.py logging overhaul 2024-04-01 23:42:07 -04:00
webhook.py logging overhaul 2024-04-01 23:42:07 -04:00