lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] ip_addr_isbroadcast processing


From: Mandeep Sandhu
Subject: Re: [lwip-users] ip_addr_isbroadcast processing
Date: Tue, 8 Sep 2009 19:30:32 +0530

On Tue, Sep 8, 2009 at 12:30 PM, Simon Goldschmidt<address@hidden> wrote:
>> On Mon, Sep 7, 2009 at 6:49 PM, Kieran Mansley<address@hidden> wrote:
>> > On Mon, 2009-09-07 at 18:05 +0530, Mandeep Sandhu wrote:
>> >> Hi All,
>> >>
>> >> I have a question on the function ip_addr_isbroadcast():
>> >>
>> >> Why do we check for destination address even before we've determined
>> >> if the network interface supports broadcast or not? Shouldn't that be
>> >> the first check?
>> >
>> > I don't know.  To be honest, I'm a bit surprised the second check is
>> > there (and that the function takes a netif as argument at all).  It
>> > would make more sense to be that the function that tests if the address
>> > is broadcast just tests the address, not the interface properties as
>> > well.
>>
>> Isn't the netif being used to determine if the passed address fits in
>> as a subnet broadcast address?
>
> Exactly. And I think the function is OK like it is as it first checks whether 
> it is a known broadcast address and then checks whether it is netif-specific 
> one (and returns false if it cannot do this check because the netif doesn't 
> support it).

So you're saying an interface's broadcast flag is meant only for
direct (or subnet) broadcasts? It's ok to accept the "all hosts"
broadcast even though subnet broadcast might not be allowed?

Well, if that is true then the check in ip_input, where we check if
the netif is NULL, will never happen for DHCP packets (Offer/Ack)
since they come with a dest IP of 255.255.255.255 and for this address
we will always use the first netif!

So should we fix the ip_input fxn or this one?

-mandeep

>
> Simon
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]