[haiku-development] Re: BNetworkInterface weirdness

  • From: Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Sun, 7 Apr 2013 21:25:13 +0200

2013/4/7 Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>

> 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.
>
>
> I didn't know that. I thought there could be only one default gateway for
interface, and you could have different default gateways only if you have
multiple interfaces (or multiple IP addresses on the same interface).

Other related posts: