Sibyx / BinksRouter

Simple .NET based network router for Windows implemented in C# using WPF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

There is bug in Routing Algorithm

ashkan-moghadasi opened this issue · comments

Our routing algorithm must prefer more specific routes as the best route of routing algorithm however I think you act vice versa
in RoutingTable.Resolve()

if (bestRoute == null || bestRoute.NetworkMask.ToInt() > route.NetworkMask.ToInt())
{
bestRoute = route;
}
Must Be

if (bestRoute == null || bestRoute.NetworkMask.ToInt()< route.NetworkMask.ToInt())
{
bestRoute = route;
}

Hello @ashkan-moghadasi,
thank you very much for reporting. It's been a while since I was working on this project (I always wanted to write a blog post about writing software router in .NET). I have to admit I don't have prepared a laboratory to test such use-case. Feel free to offer a PR with some experimental proof.