lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Extended udp_recv callback


From: Jakob Stoklund Olesen
Subject: Re: [lwip-devel] Extended udp_recv callback
Date: Tue, 13 Jan 2009 16:27:17 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

bill wrote:
> Just a thought: Why not put the netif in the pcb so it's available
> everywhere?  If you need it here, sure enough someone will need it somewhere
> else some day.  This would save the overhead on the call making it a
> one-time store.  And it wouldn't affect lwIP application code.

Hi Bill,

If the pcb is bound locally to IP_ADDR_ANY (0.0.0.0) it can receive
packets from any interface. udp_input() accepts a packet for a pcb if:

- pcb->local_ip == 0.0.0.0 or iphdr->dest, or
- packet is multicast, or
- packet is broadcast.

A pcb does not belong to a netif, so I am not sure it is a good idea to
store the netif in the pcb. It would not be a one-time store, you would
have to store it in udp_input every time.

/stoklund




reply via email to

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