# HG changeset patch # User Pat Downey # Date 1279037633 -3600 # Node ID 87bcfc2c9c1ece29ff58f3b796e01201c5af847c # Parent d566d76acea1cb16feae948fc3210c3d80641c19# Parent f44b73583a2fd038cc3d14dd9209981e2345370f Merge fixes for bug 1894 and bug 3108. diff -r f44b73583a2f -r 87bcfc2c9c1e linklayercontrol/networkinterfacemgr/agentprcore/src/CAgentAdapter.cpp --- a/linklayercontrol/networkinterfacemgr/agentprcore/src/CAgentAdapter.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/linklayercontrol/networkinterfacemgr/agentprcore/src/CAgentAdapter.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -155,12 +155,9 @@ { iAgent->CancelReconnect(); } - // Issue disconnect only if agent is not already disconneting state - else if (iAgentState != EDisconnecting) - { - iAgentState = EDisconnecting; - iAgent->Disconnect(aReason); - } + + iAgentState = EDisconnecting; + iAgent->Disconnect(aReason); } @@ -310,9 +307,7 @@ } else { - iLastProgress.iError = aStatus; - // Set the agent state to EDisconnecting - iAgentState = EDisconnecting; + iLastProgress.iError = aStatus; iAgent->Disconnect(aStatus); } } diff -r f44b73583a2f -r 87bcfc2c9c1e linklayercontrol/networkinterfacemgr/netcfgext/inc/netcfgextnotify.h --- a/linklayercontrol/networkinterfacemgr/netcfgext/inc/netcfgextnotify.h Fri Jun 25 15:40:16 2010 +0100 +++ b/linklayercontrol/networkinterfacemgr/netcfgext/inc/netcfgextnotify.h Tue Jul 13 17:13:53 2010 +0100 @@ -38,6 +38,7 @@ MNifIfNotify interface Only IfProgress, DoReadDes and DoReadInt supported. */ + ~CNetCfgExtNotify(); void LinkLayerDown(TInt aReason, TAction aAction); void LinkLayerUp(); void NegotiationFailed(CNifIfBase* aIf, TInt aReason); diff -r f44b73583a2f -r 87bcfc2c9c1e linklayercontrol/networkinterfacemgr/netcfgext/src/netcfgextnotify.cpp --- a/linklayercontrol/networkinterfacemgr/netcfgext/src/netcfgextnotify.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/linklayercontrol/networkinterfacemgr/netcfgext/src/netcfgextnotify.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -35,11 +35,19 @@ { } +CNetCfgExtNotify::~CNetCfgExtNotify() + { + iScpr = NULL; + } + void CNetCfgExtNotify::IfProgress(TInt aStage, TInt aError) { TStateChange change(aStage, aError); + if(iScpr) + { RClientInterface::OpenPostMessageClose(iScpr->Id(), iScpr->Id(), TCFMessage::TStateChange(change).CRef()); + } } TInt CNetCfgExtNotify::DoReadInt(const TDesC& aField, TUint32& aValue,const RMessagePtr2* /*aMessage*/) diff -r f44b73583a2f -r 87bcfc2c9c1e networkcontrol/commsuserpromptmgr/state/src/netupsstatemachine.cpp --- a/networkcontrol/commsuserpromptmgr/state/src/netupsstatemachine.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/networkcontrol/commsuserpromptmgr/state/src/netupsstatemachine.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -71,27 +71,71 @@ // Note the order in which the states are instantiated must match the // order in which they are defined in the enumeration TNetUpsState - or a panic will occur. - iState.Append(CState::NewL(ENull, *this)); + CState* state=CState::NewL(ENull, *this); + + CleanupStack::PushL(state); + iState.AppendL(state); + CleanupStack::Pop(state); + switch(iNetUpsImpl.LifeTimeMode()) { + case CNetUpsImpl::EProcessLifeTimeMode: { - iState.Append(CState::NewL(EProcLife_NonSession, *this)); - iState.Append(CState::NewL(EProcLife_Transit_SessionYes, *this)); // a transient state is entered when the UPS Server responds with either SessionYes or SessionNo and there are 1 or more UPS requests outstanding to other subsessions which are associated with the same process. - iState.Append(CState::NewL(EProcLife_SessionYes, *this)); - iState.Append(CState::NewL(EProcLife_Transit_SessionNo, *this)); - iState.Append(CState::NewL(EProcLife_SessionNo, *this)); + CState* stateone= CState::NewL(EProcLife_NonSession, *this); + CleanupStack::PushL(stateone); + iState.AppendL(stateone); + + CState* statetwo = CState::NewL(EProcLife_Transit_SessionYes, *this); + CleanupStack::PushL(statetwo); + iState.AppendL(statetwo); // a transient state is entered when the UPS Server responds with either SessionYes or SessionNo and there are 1 or more UPS requests outstanding to other subsessions which are associated with the same process. + + CState* statethree = CState::NewL(EProcLife_SessionYes, *this); + CleanupStack::PushL(statethree); + iState.AppendL(statethree); + + CState* statefour = CState::NewL(EProcLife_Transit_SessionNo, *this); + CleanupStack::PushL(statefour); + iState.AppendL(statefour); + + CState* statefive = CState::NewL(EProcLife_SessionNo, *this); + CleanupStack::PushL(statefive); + iState.AppendL(statefive); + + CleanupStack::Pop(5); break; } case CNetUpsImpl::ENetworkLifeTimeMode: { - iState.Append(CState::NewL(ENetLife_NonSession, *this)); - iState.Append(CState::NewL(ENetLife_SessionNo_Transit_WithoutConnections, *this)); - iState.Append(CState::NewL(ENetLife_SessionNo_WithOutConnections, *this)); - iState.Append(CState::NewL(ENetLife_SessionNo_Transit_WithConnections, *this)); - iState.Append(CState::NewL(ENetLife_SessionNo_WithConnections, *this)); - iState.Append(CState::NewL(ENetLife_Transit_SessionYes, *this)); - iState.Append(CState::NewL(ENetLife_SessionYes, *this)); + CState* stateone = CState::NewL(EProcLife_NonSession, *this); + CleanupStack::PushL(stateone); + iState.AppendL(stateone); + + CState* statetwo = CState::NewL(ENetLife_SessionNo_Transit_WithoutConnections, *this); + CleanupStack::PushL(statetwo); + iState.AppendL(statetwo); + + CState* statethree = CState::NewL(ENetLife_SessionNo_WithOutConnections, *this); + CleanupStack::PushL(statethree); + iState.AppendL(statethree); + + CState* statefour = CState::NewL(ENetLife_SessionNo_Transit_WithConnections, *this); + CleanupStack::PushL(statefour); + iState.AppendL(statefour); + + CState* statefive = CState::NewL(ENetLife_SessionNo_WithConnections, *this); + CleanupStack::PushL(statefive); + iState.AppendL(statefive); + + CState* statesix = CState::NewL(ENetLife_Transit_SessionYes, *this); + CleanupStack::PushL(statesix); + iState.AppendL(statesix); + + CState* stateseven = CState::NewL(ENetLife_SessionYes, *this); + CleanupStack::PushL(stateseven); + iState.AppendL(stateseven); + + CleanupStack::Pop(7); break; } default: diff -r f44b73583a2f -r 87bcfc2c9c1e networkcontrol/ipnetworklayer/addressinfohook/src/hookaddrinfo.cpp --- a/networkcontrol/ipnetworklayer/addressinfohook/src/hookaddrinfo.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/networkcontrol/ipnetworklayer/addressinfohook/src/hookaddrinfo.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -38,8 +38,10 @@ EXPORT_C void CHookAddressInfo::AddL(CIPProtoBinder* aBinder, CSubConIPAddressInfoParamSet::TSubConIPAddressInfo& aAddrInfo) { TIpAddrBinder *addrBinder = new(ELeave) TIpAddrBinder(aBinder, aAddrInfo); - - iAddrInfo.Append(addrBinder); + + CleanupStack::PushL(addrBinder); + iAddrInfo.AppendL(addrBinder); + CleanupStack::Pop(addrBinder); //Try match the address info to existing flows TDblQueIter iter(*iFlows); diff -r f44b73583a2f -r 87bcfc2c9c1e networkcontrol/ipnetworklayer/inc/IPProtoCPR.h --- a/networkcontrol/ipnetworklayer/inc/IPProtoCPR.h Fri Jun 25 15:40:16 2010 +0100 +++ b/networkcontrol/ipnetworklayer/inc/IPProtoCPR.h Tue Jul 13 17:13:53 2010 +0100 @@ -194,6 +194,7 @@ TBool iLinkUp:1; TBool iConnectionControlActivity:1; TBool iTimerExpired:1; + TBool iTimerStopped:1; TBool iTimerRunning:1; TBool iSubConnEventDataSent:1; // Hack to cope with multiple DataClientStatusChange notifications for 'stopped' TBool iNodeLocalExtensionsCreated; diff -r f44b73583a2f -r 87bcfc2c9c1e networkcontrol/ipnetworklayer/inc/ipprotodeftscpr.h --- a/networkcontrol/ipnetworklayer/inc/ipprotodeftscpr.h Fri Jun 25 15:40:16 2010 +0100 +++ b/networkcontrol/ipnetworklayer/inc/ipprotodeftscpr.h Tue Jul 13 17:13:53 2010 +0100 @@ -103,6 +103,8 @@ CNifConfigurationControl* iControl; Messages::RNodeInterface iFlow; TBool iIoctlCancelled; +public: + TBool iNetworkConfigurationState; }; #endif //SYMBIAN_IPPROTODEFTSCPR_H diff -r f44b73583a2f -r 87bcfc2c9c1e networkcontrol/ipnetworklayer/src/IPProtoCPR.cpp --- a/networkcontrol/ipnetworklayer/src/IPProtoCPR.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/networkcontrol/ipnetworklayer/src/IPProtoCPR.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -757,6 +757,7 @@ if (!iTimerExpired) { iTimerExpired = ETrue; + iTimerStopped = ETrue; CancelTimer(); if (CountActivities(ECFActivityStop) == 0 && CountActivities(ECFActivityDestroy) == 0) { diff -r f44b73583a2f -r 87bcfc2c9c1e networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp --- a/networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -150,7 +150,7 @@ // stop has been caused by timer expiry, remove self from originators list, because we // are not waiting for TStopped and in certain situations it would arrive after the node has been // destroyed - if (iContext.Node().iTimerExpired) + if (iContext.Node().iTimerStopped) { TInt selfidx = iContext.iNodeActivity->FindOriginator(iContext.Node().SelfInterface()); ASSERT(selfidx != KErrNotFound); @@ -378,6 +378,7 @@ iContext.Node().SetUsageProfile(KConnProfileMedium); iContext.Node().SetTimerMode(CIPProtoConnectionProvider::ETimerMedium); + iContext.Node().iTimerStopped = EFalse; CoreNetStates::TSendStarted transition(iContext); transition.DoL(); } diff -r f44b73583a2f -r 87bcfc2c9c1e networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp --- a/networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -164,7 +164,8 @@ ALegacySubConnectionActiveApiExt(this), TIfStaticFetcherNearestInHierarchy(this), iNotify(NULL), - iControl(NULL) + iControl(NULL), + iNetworkConfigurationState(EFalse) { LOG_NODE_CREATE(KIPProtoDeftScprTag, CIPProtoDeftSubConnectionProvider); } @@ -195,10 +196,25 @@ CIPProtoDeftSubConnectionProvider::~CIPProtoDeftSubConnectionProvider() { + // In case network is not configured i.e. AP might get close in case for WIFi for an example, DHCP registration + //will get failed. There is not point listening to such Progresses. So can notification and delete + //delete CNetCfgExtNotify pointer). + if(iNetworkConfigurationState == EFalse) + { + if(iNotify) + { + delete iNotify; + iNotify = NULL; + } + } if (iControl) delete iControl; + //incase registration is successful and Network is configured. if (iNotify) + { delete iNotify; + iNotify = NULL; + } LOG_NODE_DESTROY(KIPProtoDeftScprTag, CIPProtoDeftSubConnectionProvider); } diff -r f44b73583a2f -r 87bcfc2c9c1e networkcontrol/ipnetworklayer/src/ipprotodeftscprstates.cpp --- a/networkcontrol/ipnetworklayer/src/ipprotodeftscprstates.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/networkcontrol/ipnetworklayer/src/ipprotodeftscprstates.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -162,6 +162,7 @@ if (msg.iStateChange.iStage == KLinkLayerOpen) { + iContext.Node().iNetworkConfigurationState = ETrue; return KNetworkConfigured; } @@ -171,7 +172,11 @@ DEFINE_SMELEMENT(TNetworkConfiguredOrErrorTagOrCancelTagOrNoTagBackward, NetStateMachine::MStateFork, IPProtoDeftSCpr::TContext) TInt IPProtoDeftSCpr::TNetworkConfiguredOrErrorTagOrCancelTagOrNoTagBackward::TransitionTag() { + iContext.Node().iNetworkConfigurationState = EFalse; TInt tag = IPProtoDeftSCpr::TNetworkConfiguredOrErrorTagOrCancelTagOrNoTag::TransitionTag(); + + + if (tag == KNoTag) return tag | NetStateMachine::EBackward; return tag; diff -r f44b73583a2f -r 87bcfc2c9c1e networkprotocols/tcpipv4v6prt/inc/tcp.h --- a/networkprotocols/tcpipv4v6prt/inc/tcp.h Fri Jun 25 15:40:16 2010 +0100 +++ b/networkprotocols/tcpipv4v6prt/inc/tcp.h Tue Jul 13 17:13:53 2010 +0100 @@ -620,7 +620,7 @@ void ProcessSegments(); void SendSegments(TBool aNagleOverride = EFalse); void RetransmitTimeout(); - void RetransmitSegments(); + TBool RetransmitSegments(); void ClearSYNSettings(); /** diff -r f44b73583a2f -r 87bcfc2c9c1e networkprotocols/tcpipv4v6prt/src/tcp_sap.cpp --- a/networkprotocols/tcpipv4v6prt/src/tcp_sap.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/networkprotocols/tcpipv4v6prt/src/tcp_sap.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -1684,7 +1684,8 @@ if (iFlags.iRetransmitPending) { iFlags.iRetransmitPending = EFalse; - RetransmitSegments(); + if(RetransmitSegments()) + return; } if (iFlags.iTransmitPending) @@ -2288,7 +2289,12 @@ ++iBackoff; if (iRTO < Protocol()->MaxRTO()) // Avoid RTO overflow ResetRTO(); - + + if(DetachIfDead()) + { + Expire(); + return; + } // // Timeout? // @@ -2403,7 +2409,7 @@ // - directly from RetransmitTimeout() // - from CanSend(), in which case this is a delayed retransmission timeout // -void CProviderTCP6::RetransmitSegments() +TBool CProviderTCP6::RetransmitSegments() { ASSERT(iRetransTimer); @@ -2419,7 +2425,7 @@ { LOG(Log::Printf(_L("\ttcp SAP[%u] RetransmitSegments(): Flow pending"), (TInt)this)); ReSchedRetransmit(); - return; + return EFalse; } // @@ -2477,14 +2483,14 @@ // the receiver suddenly shrinks its window. The current solution covers // both cases. // - return; + return EFalse; } // // This is a retransmit timout. Do we have anything to do? // if (!unacked) - return; + return EFalse; LOG(if (iFlags.iFastRetransMode) Log::Printf(_L("\ttcp SAP[%u] RetransmitSegments(): Leaving FAST RETRANS mode"), (TInt)this)); iFlags.iFastRetransMode = EFalse; @@ -2557,7 +2563,7 @@ // If the server doesn't respond because of broken NAT/FW or other, don't keep interface up. if (InState(ETcpFinWait1|ETcpClosing|ETcpLastAck)) DetachIfDead(); - return; + return EFalse; } // @@ -2567,14 +2573,14 @@ { // Retransmit SYN SendSegment(KTcpCtlSYN, iSND.UNA); - return; + return EFalse; } if (InState(ETcpSynReceived)) { // Retransmit SYN,ACK SendSegment(KTcpCtlSYN|KTcpCtlACK, iSND.UNA); - return; + return EFalse; } if (InState(ETcpFinWait1|ETcpClosing|ETcpLastAck)) @@ -2584,18 +2590,22 @@ //TSW error:JHAA-82JBNG -- FIN retransmission //Depending on the function return value the decision to //retransmitt FIN is decided - - TBool continue_send = DetachIfDead(); + // Retransmit FIN - if(continue_send == EFalse) + if(DetachIfDead()== EFalse) + { SendSegment(KTcpCtlFIN|KTcpCtlACK, iSND.UNA); - return; + return EFalse; + } } LOG(Log::Printf(_L("\ttcp SAP[%u] RetransmitSegments(): Retransmitter stopping"), (TInt)this)); if (!iSockFlags.iAttached) + { Expire(); - return; + return ETrue; + } + return EFalse; } diff -r f44b73583a2f -r 87bcfc2c9c1e networksecurity/ipsec/ipsecpol/src/ipsecpolmanhandler.cpp --- a/networksecurity/ipsec/ipsecpol/src/ipsecpolmanhandler.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/networksecurity/ipsec/ipsecpol/src/ipsecpolmanhandler.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -1450,7 +1450,9 @@ if (autoloadListItem != NULL) { - iScopedAutoloadPolicyPairs.Append(autoloadListItem); + CleanupStack::PushL(autoloadListItem); + iScopedAutoloadPolicyPairs.AppendL(autoloadListItem); + CleanupStack::Pop(autoloadListItem); } } diff -r f44b73583a2f -r 87bcfc2c9c1e networksecurity/ipsec/ipsecpol/src/ipsecpolmanutil.cpp --- a/networksecurity/ipsec/ipsecpol/src/ipsecpolmanutil.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/networksecurity/ipsec/ipsecpol/src/ipsecpolmanutil.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -73,7 +73,7 @@ if (j==count) { TInt position = 0; - gatewayList.Insert( &itemL->iTunnel, position); + gatewayList.InsertL( &itemL->iTunnel, position); // Build two strings for policy file stringBuf.Zero(); diff -r f44b73583a2f -r 87bcfc2c9c1e tcpiputils/dhcp/src/DHCPStateMachine.cpp --- a/tcpiputils/dhcp/src/DHCPStateMachine.cpp Fri Jun 25 15:40:16 2010 +0100 +++ b/tcpiputils/dhcp/src/DHCPStateMachine.cpp Tue Jul 13 17:13:53 2010 +0100 @@ -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 + error = iSocket.SetOpt(KSoKeepInterfaceUp, KSolInetIp, 0); + if(error != KErrNone) + { + __CFLOG_VAR((KLogSubSysDHCP, KLogCode, _L("CDHCPStateMachine::RemoveConfiguredAddress, SetOpt Failed to set KSolInetIp"))); + } + } + else + { + __CFLOG_VAR((KLogSubSysDHCP, KLogCode, _L("CDHCPStateMachine::RemoveConfiguredAddress,SetOpt Failed to set KsolInetIfCtrl"))); + } + } + else + { + __CFLOG_VAR((KLogSubSysDHCP, KLogCode, _L("CDHCPStateMachine::RemoveConfiguredAddress,Socket Open Failed: Due to %d"),error)); + } } void CDHCPStateMachine::ConfigureInterfaceL( const TSoInet6InterfaceInfo& aInterfaceInfo ) diff -r f44b73583a2f -r 87bcfc2c9c1e tcpiputils/networkaddressandporttranslation/TE_Napt/configs/Te_NaptConnection_target.xml --- a/tcpiputils/networkaddressandporttranslation/TE_Napt/configs/Te_NaptConnection_target.xml Fri Jun 25 15:40:16 2010 +0100 +++ b/tcpiputils/networkaddressandporttranslation/TE_Napt/configs/Te_NaptConnection_target.xml Tue Jul 13 17:13:53 2010 +0100 @@ -822,7 +822,7 @@ ip 255.255.255.0 10.32.194.254 - 10.225.164.209 + 10.225.171.70 TRUE TRUE 194.72.6.51 diff -r f44b73583a2f -r 87bcfc2c9c1e tcpiputils/networkaddressandporttranslation/TE_Napt/configs/Te_NaptConnection_winscw.xml --- a/tcpiputils/networkaddressandporttranslation/TE_Napt/configs/Te_NaptConnection_winscw.xml Fri Jun 25 15:40:16 2010 +0100 +++ b/tcpiputils/networkaddressandporttranslation/TE_Napt/configs/Te_NaptConnection_winscw.xml Tue Jul 13 17:13:53 2010 +0100 @@ -822,7 +822,7 @@ ip 255.255.255.0 10.32.194.254 - 10.253.27.249 + 10.225.171.70 TRUE TRUE 194.72.6.51 diff -r f44b73583a2f -r 87bcfc2c9c1e tcpiputils/networkaddressandporttranslation/TE_Napt/configs/te_naptconfig_target.ini --- a/tcpiputils/networkaddressandporttranslation/TE_Napt/configs/te_naptconfig_target.ini Fri Jun 25 15:40:16 2010 +0100 +++ b/tcpiputils/networkaddressandporttranslation/TE_Napt/configs/te_naptconfig_target.ini Tue Jul 13 17:13:53 2010 +0100 @@ -4,7 +4,7 @@ [General] NaptStatus=On -NaptTestServer=10.225.164.210 +NaptTestServer=10.225.171.71 NaptTestServerPort=48555 EthIPAddr=10.192.192.79 EchoPort = 7 diff -r f44b73583a2f -r 87bcfc2c9c1e tcpiputils/networkaddressandporttranslation/TE_Napt/configs/te_naptconfig_winscw.ini --- a/tcpiputils/networkaddressandporttranslation/TE_Napt/configs/te_naptconfig_winscw.ini Fri Jun 25 15:40:16 2010 +0100 +++ b/tcpiputils/networkaddressandporttranslation/TE_Napt/configs/te_naptconfig_winscw.ini Tue Jul 13 17:13:53 2010 +0100 @@ -4,7 +4,7 @@ [General] NaptStatus=On -NaptTestServer=10.253.27.250 +NaptTestServer=10.225.171.71 NaptTestServerPort=48555 EthIPAddr=10.192.192.79 EchoPort = 7