lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Change IP parameters during runtime


From: Stephane Lesage
Subject: Re: [lwip-users] Change IP parameters during runtime
Date: Fri, 28 Sep 2012 18:49:57 +0200

>netif_set_addr( &xEMAC_if, &( xAppCfg.xETHCfg.xETHIP ), &( xAppCfg.xETHCfg.xETHNetmask ), &( xAppCfg.xETHCfg.xETHGateway ));

>will really change the parameters "on the fly".

>It seems to work – but I want to be sure that this is an "allowed" and correct way.

>I don't want to have some stuff stuck in memory or something like this because it's not a clean way to do it like this.

 

When I started using LwIP port Analog Devices, I did a reset like you.

But then I made I own port and could use the netif functions.

It works for me (I don’t remember exactly but we may have fixed a bug and added missing netifapi functions back then)

 

>More detailed questions:

> If this is OK, what happens with actually open TCP connections

>(in best case the same as if I break this connection by switching of the counterpart device – they will time out after a while)?

 

Active TCP connections will be closed immediately.

TCP listening on ANY address will continue to listen.

TCP listening on the old address should be closed (I never checked this case)

 

>Do I need to call the netif_set_addr() in the same task where LwIP is running,

 

Yes

 

>or is it allowed to call it also from another task (it will be ensured that nothing else will call netif_set_addr from my side at the same time)

 

You can just use netifapi_xxx functions which will do the job of executing the netif_xxx functions in the tcpip thread for you.

 

Best regards.

 

--

Stephane Lesage

 


reply via email to

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