kytos-ng / pathfinder

Kytos main path finder Network Application (NApp)
https://kytos-ng.github.io/api/pathfinder.html
MIT License
0 stars 7 forks source link

pathfinder isn't considering node interface `is_active()` state, so it can find a path that is down #10

Closed viniarck closed 2 years ago

viniarck commented 2 years ago

When I was reviewing the code and running some exploratory tests, I realized that when the graph is being built and adding a node, it's not considering the status of the interface, which leaves room to find a path that's down, and incorrectly returning it as a available path.

How to reproduce:

{
    "source": "00:00:00:00:00:00:00:01:1",
    "destination": "00:00:00:00:00:00:00:03:1"
}

response:

{
    "paths": [
        {
            "cost": 8,
            "hops": [
                "00:00:00:00:00:00:00:01:1",
                "00:00:00:00:00:00:00:01",
                "00:00:00:00:00:00:00:01:2",
                "00:00:00:00:00:00:00:02:2",
                "00:00:00:00:00:00:00:02",
                "00:00:00:00:00:00:00:02:3",
                "00:00:00:00:00:00:00:03:2",
                "00:00:00:00:00:00:00:03",
                "00:00:00:00:00:00:00:03:1"
            ]
        }
    ]
}