Sibyx / BinksRouter

Simple .NET based network router for Windows implemented in C# using WPF
9 stars 6 forks source link

There is bug in Routing Algorithm #3

Open ashkan-moghadasi opened 1 year ago

ashkan-moghadasi commented 1 year ago

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; }

Sibyx commented 1 year ago

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.