lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] ICMP disable - runtime


From: Kieran Mansley
Subject: Re: [lwip-devel] ICMP disable - runtime
Date: Mon, 10 Nov 2008 16:54:30 +0000

On Mon, 2008-11-10 at 17:39 +0100, Piero 74 wrote:
> Hi all.
> 
> Our marketing group asked me if it could be possible add a feature to
> my lwip based board:
> they want that board implements ICMP (so, sends ping answer) in
> default version, but they also want the possibility to disable it
> using a tcp command. (to avoid hacking)
> I have non volatile memory on my board, so i can save this information
> and force a hot restart of board (so, restart lwip stack and
> application).
> 
> But i saw in code only a define for compile/not compile ICMP: how can
> change this  to manage ICMP on/off after a reset? 
> (i'm thinking to put an "if(optionPingEnabled)..." everywhere i see
> LWIP_ICMP,

That would work.

>  but i'd like don't change lwip code... i'm searching a workaround if
> exist) 

Depends what they mean by disable it.  You could minimise your changes
to lwIP by just checking the if(optionPingEnabled) in icmp_input() and
return if it has been disabled.  That would still leave some ICMP code
active though, for example the stack would still send "destination
protocol unreachable" in ip_input() in some circumstances.

An alternative that would not need any mods to lwIP would be to snoop
the IP header protocol field on all packets in your driver and drop any
that have the ICMP type when the protocol is disabled.

Kieran 





reply via email to

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