help_vars.Add(EnumVariable('OIC_SUPPORT_TIZEN_TRACE', 'Tizen Trace(T-trace) api availability', 'False', allowed_values=('True', 'False')))
help_vars.Add(BoolVariable('WITH_PROCESS_EVENT','Build including process event logics in ocstack', 'False'))
help_vars.Add(BoolVariable('DISABLE_AUTO_TCP_NSPROVIDER_DISCOVERY', 'Disable auto-discovery of NSProvider over TCP for TCP connected events', False))
+help_vars.Add(BoolVariable('ENABLE_DUP','Enable duplicate IPv4/IPv6 packets', 'False'))
AddOption('--prefix',
dest='prefix',
type='string',
if env.get('DISABLE_AUTO_TCP_NSPROVIDER_DISCOVERY'):
env.AppendUnique(CPPDEFINES = ['DISABLE_AUTO_TCP_NSPROVIDER_DISCOVERY'])
+if env.get('ENABLE_DUP'):
+ env.AppendUnique(CPPDEFINES = ['ENABLE_DUP'])
+
libs = []
if env.get('SECURED') == '1':
defines.append('-D__WITH_DTLS__=1')
{
CAHistoryItem_t *item = &(history->items[i]);
if (id == item->messageId && tokenLength == item->tokenLength
- && memcmp(item->token, token, tokenLength) == 0)
+#ifndef ENABLE_DUP
+ && ep->ifindex == item->ifindex && memcmp(item->token, token, tokenLength) == 0)
+ {
+ OIC_LOG_V(INFO, TAG, "IPv%c duplicate message ignored",
+ familyFlags & CA_IPV6 ? '6' : '4');
+ ret = true;
+ break;
+ }
+#else
+ && memcmp(item->token, token, tokenLength) == 0)
{
if ((familyFlags ^ item->flags) == CA_IPFAMILY_MASK)
{
ret = true;
break;
}
- }
+ }
+#endif
}
history->items[history->nextIndex].flags = familyFlags;
history->items[history->nextIndex].messageId = id;
+#ifndef ENABLE_DUP
+ history->items[history->nextIndex].ifindex = ep->ifindex;
+#endif
if (token && tokenLength)
{
memcpy(history->items[history->nextIndex].token, token, tokenLength);