[haiku-development] Re: BNetworkInterface weirdness

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 07 Apr 2013 19:59:05 +0200

On 04/07/2013 04:03 PM, Stefano Ceccherini wrote:
2013/4/7 Axel Dörfler <axeld@xxxxxxxxxxxxxxxx
<mailto:axeld@xxxxxxxxxxxxxxxx>>
>   There actually can be any number of default routes.
>   What's obviously missing in BNetworkInterface is a way to enumerate
>   the existing routes, though, which you can then use to find the
>   default route(s).
You're right, and I actually used the wrong term. What I need is the
default gateway, and there can be only one of that.
I'd add a status_t GetDefaultGateway(BNetworkInterfaceAddress&) to the
class to obtain that.

No, each default route can have its own gateway. The better metric decides where the packet goes to, and if two routes have the same metric, they should be alternated (not sure if we actually do the latter).

Bye,
   Axel.


Other related posts: