lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Re: [lwip-users] filter broadcast packet


From: Jonathan Larmour
Subject: Re: [lwip-devel] Re: [lwip-users] filter broadcast packet
Date: Fri, 25 Jan 2008 15:25:07 +0000
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

Piero 74 wrote:
> 
> My  board will be a simple device  in a typical windows or unix
> network,  which  will accept tcp connection for  options programming 
> and upgrade, and send/receive udp packets on event.
> For marketing reason it has to implement DHCP.
> So my idea:
> 1. on bootstrap, using dhcp session for get IP -----> driver will not
> block broadcast packet
> 2. when a new IP is available, enable broadcast packet filtering, except ARP
> 
> What do you think?

You would have to make sure it worked for DHCP renewals as well.

>     But backing up a little, since the packets have to be processed by the
>     tcpip thread really, you may be able to do that directly from your IRQ,
>     rather than from another separate thread. It depends on whether your
>     mailbox implementation is interrupt-safe. If it is, then you could
>     post it
>     to the mailbox directly.
> 
> 
> mmmmm..... I  want to understand your suggest....
> 
> Do you suggest to me to execute code of ethernetif_input in irq
> function? i saw that this function answer to arp packet and send packet
> pbuf to mailbox using tcpip_input.

No!

This was a problem with code in 1.2.0 and earlier. The ARP code is not safe
to call from any context other than the tcpip thread. For current CVS (and
1.3.0) you need to be calling tcpip_input, which will automatically deal
with the ARP processing for you, but will do it all in the correct context
of the tcpip thread.

What I'm suggesting is calling tcpip_input from your irq, but only if your
mboxes are irq-safe.

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine




reply via email to

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