Revision: 201039
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 02:45:20 +0300
changeset 69 955592283707
parent 66 34ec136802c5
Revision: 201039 Kit: 201039
linklayerprotocols/ethernetnif/EtherPkt/CardCtl.cpp
networkcontrol/ipnetworklayer/src/IPProtoSCPR.cpp
networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp
networkprotocols/iphook/inhook6/src/in_pkt.cpp
networkprotocols/tcpipv4v6prt/src/tcp.cpp
networksecurity/tls/group/tls.iby
networksecurity/tls/protocol/AlertProtocolEvents.cpp
networksecurity/tls/protocol/tlsconnection.cpp
package_definition.xml
package_map.xml
tcpiputils/dhcp/src/DHCPControl.cpp
--- a/linklayerprotocols/ethernetnif/EtherPkt/CardCtl.cpp	Fri Sep 17 08:38:11 2010 +0300
+++ b/linklayerprotocols/ethernetnif/EtherPkt/CardCtl.cpp	Mon Oct 04 02:45:20 2010 +0300
@@ -328,8 +328,9 @@
 	
 	User::LeaveIfError(fileSrv.Connect());
 	User::LeaveIfError(macFile.Open(fileSrv,KEtherMacFileName,EFileRead));
+	CleanupClosePushL(macFile);
 	User::LeaveIfError(macFile.Read(macAddress,12));
-	macFile.Close();
+	CleanupStack::PopAndDestroy(&macFile);
 	fileSrv.Close();
 	controlBuf.SetLength(8);	
 	controlBuf[0] = KEthSpeed10BaseT;
--- a/networkcontrol/ipnetworklayer/src/IPProtoSCPR.cpp	Fri Sep 17 08:38:11 2010 +0300
+++ b/networkcontrol/ipnetworklayer/src/IPProtoSCPR.cpp	Mon Oct 04 02:45:20 2010 +0300
@@ -160,7 +160,7 @@
 CIPProtoSubConnectionProvider::~CIPProtoSubConnectionProvider()
     {
 	if (iControl)
-		delete iControl;
+		iControl->AsyncDelete();
 	if (iNotify)
 		delete iNotify;
 
--- a/networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp	Fri Sep 17 08:38:11 2010 +0300
+++ b/networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp	Mon Oct 04 02:45:20 2010 +0300
@@ -202,7 +202,7 @@
            }
        }
 	if (iControl)
-		delete iControl;
+		iControl->AsyncDelete();
 	//incase registration is successful and Network is configured. 
 	if (iNotify)
 	    {
--- a/networkprotocols/iphook/inhook6/src/in_pkt.cpp	Fri Sep 17 08:38:11 2010 +0300
+++ b/networkprotocols/iphook/inhook6/src/in_pkt.cpp	Mon Oct 04 02:45:20 2010 +0300
@@ -85,7 +85,7 @@
 			if (len < aMin)
 				return NULL;
 			iLength = len;
-			return p->Buffer() + offset;
+			return p->Buffer() ? (p->Buffer() + offset) : NULL;
 			}
 		// The requested alignment value is not
 		// satisfied!
--- a/networkprotocols/tcpipv4v6prt/src/tcp.cpp	Fri Sep 17 08:38:11 2010 +0300
+++ b/networkprotocols/tcpipv4v6prt/src/tcp.cpp	Mon Oct 04 02:45:20 2010 +0300
@@ -263,6 +263,13 @@
 #ifdef _LOG
 		LogPacket('<', seg, info, info->iOffset);
 		pkt.Set(seg, info->iOffset, pkt.iHdr->HeaderLength()); // LogPacket() may have realigned the header.
+		
+		if (!pkt.iHdr)
+		    {
+		    LOG(Log::Printf(_L("\ttcp Process() header alignment failed. Packet discarded")));
+		    seg.Free();
+		    return;
+		    }
 #endif
 
 		// Verify TCP checksum
--- a/networksecurity/tls/group/tls.iby	Fri Sep 17 08:38:11 2010 +0300
+++ b/networksecurity/tls/group/tls.iby	Mon Oct 04 02:45:20 2010 +0300
@@ -20,7 +20,7 @@
 
 #include <certman.iby>
 // DEF139848 fix - Forward Propogation from Symtb9.1 - Illegal dependency from OCSP to HTTP.
-#include <ocsp.iby>
+#include <ocsp_ncp.iby>
 
 #include <tlsprovider.iby>
 #include <NETSM.iby>
--- a/networksecurity/tls/protocol/AlertProtocolEvents.cpp	Fri Sep 17 08:38:11 2010 +0300
+++ b/networksecurity/tls/protocol/AlertProtocolEvents.cpp	Mon Oct 04 02:45:20 2010 +0300
@@ -124,6 +124,13 @@
 			}
 		case KErrSSLAlertCloseNotify:
 			{
+			    if ( iStateMachine->iStatus.Int() == KRequestPending ||
+			            iRecordComposer.CurrentPos() != 0 ||
+			            iRecordComposer.UserData()!= NULL )
+			        {
+			        LOG(Log::Printf(_L("Previous data send request is in the pending state"));)
+			        return this;
+			        }
 				//Upon sending the close_notify from server report KErrEof to the application 
 				//to be intact with existing behaviour.	
 				iStateMachine->SetLastError( KErrEof );
@@ -153,7 +160,6 @@
 		case KErrCancel:
 			{// A user_canceled alert should be followed by a close_notify alert. So this
 			 // event will be the next one to be processed. 
-				iRecordComposer.SetNext( NULL );
 				iAlertMsg.Append( EAlertWarning );
 				iAlertMsg.Append( EAlertclose_notify );
 				iRecordComposer.SetNext( NULL );
@@ -198,13 +204,19 @@
 	LOG(Log::Printf(_L("CRecvAlert::ProcessL(). Alert level = %d"), alertLevel ));
 	LOG(Log::Printf(_L("CRecvAlert::ProcessL(). Alert description = %d"), alertDesc ));
 
+	if ( alertLevel == EAlertFatal )
+	    {
 	TRequestStatus* p=&aStatus;
-	User::RequestComplete( p, KErrNone );
-	if ( alertLevel == EAlertWarning )
+	    User::RequestComplete( p, KErrSSLAlertHandshakeFailure );
+	    iStateMachine->SetLastError( KErrSSLAlertHandshakeFailure );
+	    }
+	else if ( alertLevel == EAlertWarning )
 	   {// In all circumstances, when a warning alert is received, we carry on as normal.
 		// There is no need to set the next event as this will be unchanged from normal
 		// operation. For a Close_notify alert, we must send one in response.
 		// So the next event will be CSendAlert sending a close-notify alert.
+	    TRequestStatus* p=&aStatus;
+	    User::RequestComplete( p, KErrNone );
       if ( alertDesc == EAlertclose_notify )
          {
          iStateMachine->SetLastError( KErrSSLAlertCloseNotify );
--- a/networksecurity/tls/protocol/tlsconnection.cpp	Fri Sep 17 08:38:11 2010 +0300
+++ b/networksecurity/tls/protocol/tlsconnection.cpp	Mon Oct 04 02:45:20 2010 +0300
@@ -1184,6 +1184,7 @@
    __ASSERT_DEBUG( !aStateMachine->SuspendRequest(), TlsPanic(ETlsPanicStateMachineStopped) );
    if ( aStateMachine->LastError() != KErrNone )
    {//user will be notified after return from this fn
+       LOG(Log::Printf(_L("CTlsConnection::OnCompletion() aStateMachine->LastError() %d"), aStateMachine->LastError() );)
 	   if ( iHandshake != aStateMachine )
 	      {
 		   return EFalse;
@@ -1209,6 +1210,7 @@
          {//something went completely wrong
           //set last error so that the user will be notified after return from this fn
             aStateMachine->SetLastError( ret );
+            LOG(Log::Printf(_L("CTlsConnection::OnCompletion() - AppData->ResumeL Last Error %d"), aStateMachine->LastError() );)
             delete iSendAppData;
             iSendAppData = NULL;
             delete iRecvAppData;
@@ -1233,6 +1235,7 @@
 	     // Create the Data state machines so that the user can send/receive data
          __ASSERT_DEBUG( !iRecvAppData && !iSendAppData, TlsPanic(ETlsPanicStateMachineAlreadyExists));
       
+         LOG(Log::Printf(_L(" Create the Data state machines so that the user can send/receive data") );)
 	     //don't change the order see CRecvAppData::ResumeL
 	     TRAPD( ret, iSendAppData = CSendAppData::NewL( *iRecordComposer );
 		     iRecvAppData = CRecvAppData::NewL( *this ) );
@@ -1240,6 +1243,7 @@
          {//something went completely wrong
           //set last error so that the user will be notified after return from this fn
             aStateMachine->SetLastError( ret );
+            LOG(Log::Printf(_L("CTlsConnection::OnCompletion() AppData::NewL Last Error %d"), aStateMachine->LastError() );)
             //delete what may have been created
             delete iRecvAppData;
             iRecvAppData = 0;
--- a/package_definition.xml	Fri Sep 17 08:38:11 2010 +0300
+++ b/package_definition.xml	Mon Oct 04 02:45:20 2010 +0300
@@ -1,11 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <SystemDefinition schema="3.0.0">
   <package id="networkingsrv" name="Networking Services" levels="adaptation hw-if plugin framework server app-if">
-    <collection id="commsdb" name="Comms DB" level="server">
-      <component id="s60_commsdb" filter="s60" name="S60 Commsdb" class="config">
-        <unit bldFile="commsdb/s60_commsdb/group"/>
-      </component>
-    </collection>
     <collection id="esockapiextensions" name="ESock API Extensions" level="app-if">
       <component id="internetsockets" name="Internet Sockets" introduced="ER5" purpose="mandatory">
         <unit bldFile="esockapiextensions/internetsockets/group" mrp="esockapiextensions/internetsockets/group/networking_insock.mrp"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml	Mon Oct 04 02:45:20 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="os"/>
--- a/tcpiputils/dhcp/src/DHCPControl.cpp	Fri Sep 17 08:38:11 2010 +0300
+++ b/tcpiputils/dhcp/src/DHCPControl.cpp	Mon Oct 04 02:45:20 2010 +0300
@@ -94,10 +94,10 @@
 	//forced to do this horrible stuff
 	RSocket socket;
 	User::LeaveIfError(socket.Open(iEsock, KAfInet, KSockDatagram, KProtocolInetUdp,iConnection));
+	CleanupClosePushL( socket );
 	// make socket invisible for interface counting
 	User::LeaveIfError(socket.SetOpt(KSoKeepInterfaceUp, KSolInetIp, 0));
 	
-	CleanupClosePushL( socket );
 	TPckgBuf<TSoInet6InterfaceInfo> info;
 	while ( err == KErrNotFound && iConnection.Control(KCOLProvider, KConnGetInterfaceName, name) == KErrNone )
 		{