Issue : There can be duplicate messages coming from multiple ipv6 (or v4)
addresses in the system. The presence of ipv6 link-local for instance
could cause duplicate messages to appear.
Solution : Remove check based on IPv4/Ipv6
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/668
(cherry-picked from
7d5e906bedb032f88f2dd2fca97f70a631c1346e)
Change-Id: I7fd73ad9401a30192141a048db9d88cd7bfea3b6
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
uint16_t messageId;
char token[CA_MAX_TOKEN_LEN];
uint8_t tokenLength;
uint16_t messageId;
char token[CA_MAX_TOKEN_LEN];
uint8_t tokenLength;
} CAHistoryItem_t;
typedef struct
} CAHistoryItem_t;
typedef struct
{
CAHistoryItem_t *item = &(history->items[i]);
if (id == item->messageId && tokenLength == item->tokenLength
{
CAHistoryItem_t *item = &(history->items[i]);
if (id == item->messageId && tokenLength == item->tokenLength
- && memcmp(item->token, token, tokenLength) == 0)
+ && ep->ifindex == item->ifindex && memcmp(item->token, token, tokenLength) == 0)
- if ((familyFlags ^ item->flags) == CA_IPFAMILY_MASK)
- {
- OIC_LOG_V(INFO, TAG, "IPv%c duplicate message ignored",
- familyFlags & CA_IPV6 ? '6' : '4');
- ret = true;
- break;
- }
+ OIC_LOG_V(INFO, TAG, "IPv%c duplicate message ignored",
+ familyFlags & CA_IPV6 ? '6' : '4');
+ ret = true;
+ break;
}
}
history->items[history->nextIndex].flags = familyFlags;
history->items[history->nextIndex].messageId = id;
}
}
history->items[history->nextIndex].flags = familyFlags;
history->items[history->nextIndex].messageId = id;
+ history->items[history->nextIndex].ifindex = ep->ifindex;
if (token && tokenLength)
{
memcpy(history->items[history->nextIndex].token, token, tokenLength);
if (token && tokenLength)
{
memcpy(history->items[history->nextIndex].token, token, tokenLength);