Removed invalid warning when parsing flows received via ZMQ in case they contain MAC addresses

Minor interface stats fix
This commit is contained in:
Luca Deri 2015-10-08 23:42:43 +02:00
parent 2f33da062c
commit 54ceed49e8
2 changed files with 5 additions and 8 deletions

View file

@ -55,9 +55,6 @@ ParserInterface::ParserInterface(const char *endpoint) : NetworkInterface(endpoi
u_int key_id;
json_object *additional_o = json_tokener_parse(value);
if(additional_o == NULL)
ntop->getTrace()->traceEvent(TRACE_WARNING, "JSON Parse error: %s", value);
/* FIX: the key can either be numeric of a string */
key_id = atoi(key);
@ -83,13 +80,13 @@ ParserInterface::ParserInterface(const char *endpoint) : NetworkInterface(endpoi
case IN_SRC_MAC:
/* Format 00:00:00:00:00:00 */
sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
&flow.src_mac[0], &flow.src_mac[1], &flow.src_mac[2],
&flow.src_mac[3], &flow.src_mac[4], &flow.src_mac[5]);
&flow.src_mac[0], &flow.src_mac[1], &flow.src_mac[2],
&flow.src_mac[3], &flow.src_mac[4], &flow.src_mac[5]);
break;
case OUT_DST_MAC:
sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
&flow.dst_mac[0], &flow.dst_mac[1], &flow.dst_mac[2],
&flow.dst_mac[3], &flow.dst_mac[4], &flow.dst_mac[5]);
&flow.dst_mac[0], &flow.dst_mac[1], &flow.dst_mac[2],
&flow.dst_mac[3], &flow.dst_mac[4], &flow.dst_mac[5]);
break;
case IPV4_SRC_ADDR:
case IPV6_SRC_ADDR: