summaryrefslogtreecommitdiffstats
path: root/hicn-light
diff options
context:
space:
mode:
authormichele papalini <micpapal@cisco.com>2019-07-23 14:19:55 +0200
committermichele papalini <micpapal@cisco.com>2019-07-23 14:19:55 +0200
commitf12f9f6e286a2e530e9e7af14a1e28fd54502331 (patch)
treeae52001272409b8978d740afd6a1f3ac9931369d /hicn-light
parent5ca4abd6766b75a56172dd71b2ad604fe4c7ff7d (diff)
correctly handle data packets with lifetime = 0
Change-Id: I63b966d4862317863f6de3f70db9568a8472d3e8 Signed-off-by: michele papalini <micpapal@cisco.com>
Diffstat (limited to 'hicn-light')
-rw-r--r--hicn-light/src/hicn/core/message.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hicn-light/src/hicn/core/message.c b/hicn-light/src/hicn/core/message.c
index ef8fa5d91..b0140eda4 100644
--- a/hicn-light/src/hicn/core/message.c
+++ b/hicn-light/src/hicn/core/message.c
@@ -288,6 +288,8 @@ bool message_HasContentExpiryTime(const Message *message) {
uint64_t message_GetContentExpiryTimeTicks(const Message *message) {
parcAssertNotNull(message, "Parameter message must be non-null");
uint64_t expire = messageHandler_GetContentExpiryTime(message->messageHead);
+ if(expire == 0)
+ return message->receiveTime;
return message->receiveTime + forwarder_NanosToTicks(expire * 1000000ULL);
}