lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Why doesn't udp_recv callback contain the received neti


From: address@hidden
Subject: Re: [lwip-users] Why doesn't udp_recv callback contain the received netif?
Date: Tue, 25 Jun 2019 20:42:36 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

Am 25.06.2019 um 05:11 schrieb Wayne Uroda:
Hi,

Please forgive me if this is a stupid question.

I am writing a DHCP server and using udp_recv functionality to handle
incoming broadcast messages on a udp pcb.
I have enabled the BROADCAST flag on the PCB and I can receive the
incoming packets just fine. The udp pcb is bound to ip_addr_any.

When it comes time to respond to the DHCP discover message, I must use
udp_sendto_if function. Without specifying the interface, any send fails
with a routing error because all addresses associated with this first
message are either 0.0.0.0 or 255.255.255.255 (the only genuine address
available is the source hardware address, which is useless for
determining the associated netif).

Here is where I am confused. In order to call udp_sendto_if, I need to
know the netif. If I look at the udp_input function, the netif is
available there and could easily be passed as a simple parameter to the
recv callback function.

Any time I get the urge to modify lwip itself my first thought is, I
must be missing something simple, or doing something wrong. I assume
there is some foundational piece of information I am missing?

Obviously, you *are* missing a foundational piece of information: we aim
for backwards compatibility. I think we can be proud to say that old
applications mostly still work with newer versions of lwIP. Having the
netif might be good, but it's not worth bracking backwards compatibility.

Regards,
Simon



reply via email to

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