diff options
-rw-r--r-- | ctrl/libhicnctrl/src/api.c | 27 | ||||
-rw-r--r-- | hicn-light/src/hicn/config/configuration.c | 2 | ||||
-rw-r--r-- | hicn-light/src/hicn/content_store/contentStoreLRU.c | 5 | ||||
-rw-r--r-- | hicn-light/src/hicn/core/mapme.c | 11 | ||||
-rw-r--r-- | hicn-light/src/hicn/processor/fib.c | 4 | ||||
-rw-r--r-- | hicn-plugin/CMakeLists.txt | 8 |
6 files changed, 46 insertions, 11 deletions
diff --git a/ctrl/libhicnctrl/src/api.c b/ctrl/libhicnctrl/src/api.c index b836ef800..23a314c0c 100644 --- a/ctrl/libhicnctrl/src/api.c +++ b/ctrl/libhicnctrl/src/api.c @@ -26,6 +26,12 @@ #include <sys/socket.h> // socket #include <unistd.h> // close, fcntl #include <fcntl.h> // fcntl +#include <sys/types.h> // getpid +#include <unistd.h> // getpid +#ifdef __linux__ +#include <sys/syscall.h> +#define gettid() syscall(SYS_gettid) +#endif /* __linux__ */ #include <hicn/ctrl/api.h> #include <hicn/ctrl/commands.h> @@ -435,7 +441,11 @@ hc_sock_parse_url(const char * url, struct sockaddr * sa) /* FIXME URL parsing is currently not implemented */ assert(!url); - srand(time(NULL)); +#ifdef __linux__ + srand(time(NULL) ^ getpid() ^ gettid()); +#else + srand(time(NULL) ^ getpid()); +#endif /* __linux__ */ /* * A temporary solution is to inspect the sa_family fields of the passed in @@ -757,9 +767,8 @@ hc_sock_callback(hc_sock_t * s, hc_data_t ** pdata) for (;;) { int n = hc_sock_recv(s); - if (n == 0) { + if (n == 0) goto ERR_EOF; - } if (n < 0) { switch(errno) { case ECONNRESET: @@ -858,7 +867,7 @@ hc_execute_command(hc_sock_t * s, hc_msg_t * msg, size_t msg_len, } int seq = hc_sock_get_next_seq(s); - + /* Create state used to process the request */ hc_sock_request_t * request = NULL; request = hc_sock_request_create(seq, data, params->parse); @@ -887,8 +896,11 @@ hc_execute_command(hc_sock_t * s, hc_msg_t * msg, size_t msg_len, * several times before success... shall we alternate between blocking * and non-blocking mode ? */ - if (hc_sock_recv(s) < 0) - continue; //break; + int n = hc_sock_recv(s); + if (n == 0) + goto ERR_EOF; + if (n < 0) + break; int rc = hc_sock_process(s, pdata); switch(rc) { case 0: @@ -906,7 +918,10 @@ hc_execute_command(hc_sock_t * s, hc_msg_t * msg, size_t msg_len, } } +ERR_EOF: ret = data->ret; + if (!data->complete) + return -1; if (!pdata) hc_data_free(data); diff --git a/hicn-light/src/hicn/config/configuration.c b/hicn-light/src/hicn/config/configuration.c index 52dbf7a47..e41fb3e45 100644 --- a/hicn-light/src/hicn/config/configuration.c +++ b/hicn-light/src/hicn/config/configuration.c @@ -364,7 +364,7 @@ struct iovec *configuration_ProcessCreateTunnel(Configuration *config, if (symbolicNameTable_Exists(config->symbolicNameTable, symbolicName)) { logger_Log(config->logger, LoggerFacility_Config, PARCLogLevel_Error, - __func__, "Listener symbolic name already exists"); + __func__, "Connection symbolic name already exists"); goto ERR; } diff --git a/hicn-light/src/hicn/content_store/contentStoreLRU.c b/hicn-light/src/hicn/content_store/contentStoreLRU.c index 847d7a90e..76a2c8659 100644 --- a/hicn-light/src/hicn/content_store/contentStoreLRU.c +++ b/hicn-light/src/hicn/content_store/contentStoreLRU.c @@ -240,6 +240,11 @@ static bool _contentStoreLRU_PutContent(ContentStoreInterface *storeImpl, return false; } + ContentStoreEntry *storeEntry = parcHashCodeTable_Get(store->storageByName, content); + if(storeEntry){ + _contentStoreLRU_PurgeStoreEntry(store, storeEntry); + } + uint64_t expiryTimeTicks = contentStoreEntry_MaxExpiryTime; if (message_HasContentExpiryTime(content)) { diff --git a/hicn-light/src/hicn/core/mapme.c b/hicn-light/src/hicn/core/mapme.c index d5475f229..af332ede2 100644 --- a/hicn-light/src/hicn/core/mapme.c +++ b/hicn-light/src/hicn/core/mapme.c @@ -338,6 +338,10 @@ static bool mapme_setFacePending(const MapMe *mapme, const Name *name, Dispatcher *dispatcher = forwarder_GetDispatcher(mapme->forwarder); PARCEventTimer *timer; + /* Safeguard during retransmissions */ + if (!TFIB(fibEntry)) + return true; + /* * On the producer side, we have to clear the TFIB everytime we change the list * of adjacencies, otherwise retransmissions will occur to preserve them. @@ -566,6 +570,9 @@ mapme_onConnectionEvent(const MapMe *mapme, const Connection *conn_added, connec FibEntry *fibEntry = (FibEntry *)fibEntryList_Get(fiblist, i); mapme_reconsiderFibEntry(mapme, fibEntry); } + + fibEntryList_Destroy(&fiblist); + INFO(mapme, "[MAP-Me] Done"); } @@ -647,6 +654,9 @@ static bool mapme_onSpecialInterest(const MapMe *mapme, FibEntry *fibEntry = fib_Contains(fib, name); if (!fibEntry) { + INFO(mapme, "Ignored update with no FIB entry"); + return 0; +#if 0 INFO(mapme, "[MAP-Me] - Re-creating FIB entry with next hop on connection %d", conn_in_id); @@ -685,6 +695,7 @@ static bool mapme_onSpecialInterest(const MapMe *mapme, for (size_t i = 0; i < numberSet_Length(lpm_nexthops); i++) { fibEntry_AddNexthop(fibEntry, numberSet_GetItem(lpm_nexthops, i)); } +#endif } else if (!TFIB(fibEntry)) { /* Create TFIB associated to FIB entry */ diff --git a/hicn-light/src/hicn/processor/fib.c b/hicn-light/src/hicn/processor/fib.c index 6bb29c404..c67bc6773 100644 --- a/hicn-light/src/hicn/processor/fib.c +++ b/hicn-light/src/hicn/processor/fib.c @@ -424,8 +424,10 @@ void fib_Remove(FIB *fib, const Name *name, unsigned connId) { } fibEntry_RemoveNexthopByConnectionId(entry, connId); +#ifndef WITH_MAPME if (fibEntry_NexthopCount(entry) == 0) _removeNode(fib, name); +#endif /* WITH_MAPME */ } @@ -434,9 +436,11 @@ void _removeConnectionId(FibNode *n, unsigned connectionId, if(n != NULL){ if(n->is_used){ fibEntry_RemoveNexthopByConnectionId(n->entry, connectionId); +#ifndef WITH_MAPME if (fibEntry_NexthopCount(n->entry) == 0) { fibEntryList_Append(list, n->entry); } +#endif /* WITH_MAPME */ } _removeConnectionId(n->right, connectionId, list); _removeConnectionId(n->left, connectionId, list); diff --git a/hicn-plugin/CMakeLists.txt b/hicn-plugin/CMakeLists.txt index 01ac26c7c..e8347c150 100644 --- a/hicn-plugin/CMakeLists.txt +++ b/hicn-plugin/CMakeLists.txt @@ -222,16 +222,16 @@ execute_process( COMMAND bash -c "if [ ! -e ${CMAKE_CURRENT_BINARY_DIR}/vapi_json_parser.py ]; then - curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_json_parser.py?h=stable/1908 -o ${CMAKE_CURRENT_BINARY_DIR}/vapi_json_parser.py; + curl https://raw.githubusercontent.com/FDio/vpp/stable/1908/src/vpp-api/vapi/vapi_json_parser.py -o ${CMAKE_CURRENT_BINARY_DIR}/vapi_json_parser.py; fi; if [ ! -e ${CMAKE_CURRENT_BINARY_DIR}/vapi_c_gen.py ]; then - curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_c_gen.py?h=stable/1908 -o ${CMAKE_CURRENT_BINARY_DIR}/vapi_c_gen.py; + curl https://raw.githubusercontent.com/FDio/vpp/stable/1908/src/vpp-api/vapi/vapi_c_gen.py -o ${CMAKE_CURRENT_BINARY_DIR}/vapi_c_gen.py; fi; if [ ! -e ${CMAKE_CURRENT_BINARY_DIR}/vapi_cpp_gen.py ]; then - curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_cpp_gen.py?h=stable/1908 -o ${CMAKE_CURRENT_BINARY_DIR}/vapi_cpp_gen.py; + curl https://raw.githubusercontent.com/FDio/vpp/stable/1908/src/vpp-api/vapi/vapi_cpp_gen.py -o ${CMAKE_CURRENT_BINARY_DIR}/vapi_cpp_gen.py; fi; if [ ! -e ${CMAKE_CURRENT_BINARY_DIR}/vnet/ip/ip_types.api ]; then - curl https://git.fd.io/vpp/plain/src/vnet/ip/ip_types.api?h=stable/1908 -o ${CMAKE_CURRENT_BINARY_DIR}/vnet/ip/ip_types.api; + curl https://raw.githubusercontent.com/FDio/vpp/stable/1908/src/vnet/ip/ip_types.api -o ${CMAKE_CURRENT_BINARY_DIR}/vnet/ip/ip_types.api; fi; chmod +x ${CMAKE_CURRENT_BINARY_DIR}/vapi_json_parser.py ${CMAKE_CURRENT_BINARY_DIR}/vapi_c_gen.py ${CMAKE_CURRENT_BINARY_DIR}/vapi_cpp_gen.py" ) |