diff options
author | Chinh Tran <chinht@quicinc.com> | 2010-02-19 10:19:28 -0800 |
---|---|---|
committer | Chinh Tran <chinht@quicinc.com> | 2010-03-02 09:01:40 -0800 |
commit | 5cb9e15b1067eb0523f1016d997dddd35f229d58 (patch) | |
tree | e386325b6ad8699935b6e4d4ae80df3ac45953f4 /cnd/src/cnd_process.cpp | |
parent | 9850d1b062e7a5832bc3b66b814369cb57867093 (diff) | |
download | android_external_connectivity-5cb9e15b1067eb0523f1016d997dddd35f229d58.tar.gz android_external_connectivity-5cb9e15b1067eb0523f1016d997dddd35f229d58.tar.bz2 android_external_connectivity-5cb9e15b1067eb0523f1016d997dddd35f229d58.zip |
external/connectivity/(CNE): Fix SPM init problem, multiple default entries in main routing table, dynamic loading Cne/RefCne
Add APIs to delete duplicate entries in main routing table. Do not check data pointer and datalength for non-data commmand.
CRs-fixed: 227375, 227511
Diffstat (limited to 'cnd/src/cnd_process.cpp')
-rw-r--r-- | cnd/src/cnd_process.cpp | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/cnd/src/cnd_process.cpp b/cnd/src/cnd_process.cpp index baf48c6..7d57e8f 100644 --- a/cnd/src/cnd_process.cpp +++ b/cnd/src/cnd_process.cpp @@ -159,8 +159,8 @@ static int checkAndDequeueRequestInfo(struct RequestInfo *pRI); static void cnd_commandComplete(CND_Token t, CND_Errno e, void *response, size_t responselen); extern "C" const char * requestToString(int request); -extern "C" void cne_processCommand (int command, void *data, size_t datalen); -extern "C" void cne_regMessageCb(cne_messageCbType cbFn); +extern "C" cneProcessCmdFnType cne_processCommand; +extern "C" cneRegMsgCbFnType cne_regMessageCb; /** Index == commandNumber */ static CommandInfo s_commands[] = { @@ -197,12 +197,6 @@ processCommand (int command, void *data, size_t datalen, CND_Token t) LOGD ("processCommand: command=%d, datalen=%d", command, datalen); - if ((data == NULL) || (datalen == 0)) { - - LOGE ("processCommand: invalid data"); - return; - } - /* Special handling for iproute2 command to setup iproute2 table */ if ((command == CNE_REQUEST_CONFIG_IPROUTE2_CMD) && (cneServiceEnabled)) { @@ -212,6 +206,10 @@ processCommand (int command, void *data, size_t datalen, CND_Token t) unsigned char *gatewayAddr = NULL; unsigned char *ifName = NULL; + if ((data == NULL) || (datalen ==0)) { + LOGE ("processCommand: invalid data"); + return; + } cmd = ((int *)data)[0]; ifName = ((unsigned char **)data)[1]; @@ -238,7 +236,14 @@ processCommand (int command, void *data, size_t datalen, CND_Token t) } - cne_processCommand(command, data, datalen); + if(cne_processCommand != NULL) + { + cne_processCommand(command, data, datalen); + } + else + { + LOGE("cne_processCommand is NULL"); + } cnd_commandComplete(t, CND_E_SUCCESS, NULL, 0); return; } @@ -1128,7 +1133,14 @@ cnd_init (void) s_registerCalled = 1; cneServiceEnabled = cnd_event_init(); - cne_regMessageCb(cnd_sendUnsolicitedMsg); + if(cne_regMessageCb != NULL) + { + cne_regMessageCb(cnd_sendUnsolicitedMsg); + } + else + { + LOGE("cne_regMessageCb is NULL"); + } s_fdListen = android_get_control_socket(SOCKET_NAME_CND); if (s_fdListen < 0) { |