Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - if_link_state_change(ifp, LINK_STATE_DOWN) does not remove the IP address on interface: (4 Items)
   
if_link_state_change(ifp, LINK_STATE_DOWN) does not remove the IP address on interface  
Hi All,

   I'm writing an ethernet driver and I need to sense and act as per the link status change conditions, So whenevr I 
sense the link is going down I intimate the stack by calling the API if_link_state_change(ifp, LINK_STATE_DOWN);
Here I expect the interface IP address has to be removed and the interface enters a down state, but this is not 
happening , the interface still holds the previously configured IP address (the IP address which it got by running dhcp.
client on that interface when the link status was up).

Am I missing something here, should I need to call some other API to take the interface down with the IP address removed
 from it.

Thanks,
GK
Re: if_link_state_change(ifp, LINK_STATE_DOWN) does not remove the IP address on interface  
Link and ip are two different layers.  LINK_STATE_DOWN doesn't change ip addresses.

Regards,

-seanb

----- Original Message -----
From: Ganesh Kumar [mailto:community-noreply@qnx.com]
Sent: Thursday, September 15, 2011 02:42 AM
To: drivers-networking <post88838@community.qnx.com>
Subject: if_link_state_change(ifp, LINK_STATE_DOWN) does not remove the IP address on interface

Hi All,

   I'm writing an ethernet driver and I need to sense and act as per the link status change conditions, So whenevr I 
sense the link is going down I intimate the stack by calling the API if_link_state_change(ifp, LINK_STATE_DOWN);
Here I expect the interface IP address has to be removed and the interface enters a down state, but this is not 
happening , the interface still holds the previously configured IP address (the IP address which it got by running dhcp.
client on that interface when the link status was up).

Am I missing something here, should I need to call some other API to take the interface down with the IP address removed
 from it.

Thanks,
GK



_______________________________________________

Networking Drivers
http://community.qnx.com/sf/go/post88838
Re: if_link_state_change(ifp, LINK_STATE_DOWN) does not remove the IP address on interface  
Hi Sean,

   Thanks for a quick reply.
Would you help in understanding how can I intimate the IP about the  link has gone down and it has to flush the current 
IP address it got from DHCP.
And next time on getting the link up how can that be intimated to IP and thereby re initiate the dhcp.client.

Thanks in advance,

GK 
Re: if_link_state_change(ifp, LINK_STATE_DOWN) does not remove the IP address on interface  
Use 'ifwatchd -c carrier_script'.

Regards,

-seanb

On Thu, Sep 15, 2011 at 10:58:12AM -0400, Ganesh Kumar wrote:
> Hi Sean,
> 
>    Thanks for a quick reply.
> Would you help in understanding how can I intimate the IP about the  link has gone down and it has to flush the 
current IP address it got from DHCP.
> And next time on getting the link up how can that be intimated to IP and thereby re initiate the dhcp.client.
> 
> Thanks in advance,
> 
> GK 
> 
> 
> 
> _______________________________________________
> 
> Networking Drivers
> http://community.qnx.com/sf/go/post88858
>