tcpiputils/dhcp/src/DHCPStateMachine.cpp
changeset 25 d15a50675083
parent 0 af10295192d8
--- a/tcpiputils/dhcp/src/DHCPStateMachine.cpp	Fri May 14 17:24:38 2010 +0300
+++ b/tcpiputils/dhcp/src/DHCPStateMachine.cpp	Thu May 27 14:26:17 2010 +0300
@@ -420,10 +420,29 @@
 	// how could we attempt to handle it anyway?...keep trying??? i think not...
 	// ensure that we have a socket to write down	
 	iSocket.Close();	
-	(void)iSocket.Open(iEsock, KAfInet, KSockDatagram, KProtocolInetUdp, iConnection);
-	(void)iSocket.SetOpt(KSoInetConfigInterface, KSolInetIfCtrl, configInfo);	
-	// make socket invisible for interface counting
-	(void)iSocket.SetOpt(KSoKeepInterfaceUp, KSolInetIp, 0);
+	TInt error = iSocket.Open(iEsock, KAfInet, KSockDatagram, KProtocolInetUdp, iConnection);
+	
+	if(error == KErrNone)
+	    {
+        error = iSocket.SetOpt(KSoInetConfigInterface, KSolInetIfCtrl, configInfo);
+        if(error == KErrNone)
+            {
+            // make socket invisible for interface counting
+            iSocket.SetOpt(KSoKeepInterfaceUp, KSolInetIp, 0);
+            if(error != KErrNone)
+                {
+                __CFLOG_VAR((KLogSubSysDHCP, KLogCode, _L("CDHCPStateMachine::RemoveConfiguredAddress, SetOpt Failed to set KSoKeepInterfaceUp")));
+                }
+            }
+        else
+            {
+            __CFLOG_VAR((KLogSubSysDHCP, KLogCode, _L("CDHCPStateMachine::RemoveConfiguredAddress, SetOpt Failed to set KSoInetConfigInterface")));
+            }
+	    }
+	else
+	    {
+        __CFLOG_VAR((KLogSubSysDHCP, KLogCode, _L("CDHCPStateMachine::RemoveConfiguredAddress, Socket Open Failed: Due to KErrNotReady")));
+	    }
 	}
 
 void CDHCPStateMachine::ConfigureInterfaceL( const TSoInet6InterfaceInfo& aInterfaceInfo )