diff --git a/include/Flow.h b/include/Flow.h index f689948c06..621782f245 100644 --- a/include/Flow.h +++ b/include/Flow.h @@ -83,7 +83,6 @@ class Flow : public GenericHashEntry { CounterTrend throughputTrend, goodputTrend, thptRatioTrend; #endif ndpi_protocol ndpiDetectedProtocol; - static const ndpi_protocol ndpiUnknownProtocol; custom_app_t custom_app; void *cli_id, *srv_id; char *json_info, *host_server_name, *bt_hash; @@ -242,6 +241,7 @@ class Flow : public GenericHashEntry { FlowStatus getFlowStatus(); struct site_categories* getFlowCategory(bool force_categorization); void freeDPIMemory(); + static const ndpi_protocol ndpiUnknownProtocol; bool isTiny() const; bool isLongLived() const; inline bool isSSL() const { return(isProto(NDPI_PROTOCOL_SSL)); } diff --git a/src/NetworkInterface.cpp b/src/NetworkInterface.cpp index eb2e36ab29..72fb49108d 100644 --- a/src/NetworkInterface.cpp +++ b/src/NetworkInterface.cpp @@ -1055,10 +1055,11 @@ NetworkInterface* NetworkInterface::getSubInterface(u_int32_t criteria, bool par h->iface = new NetworkInterface(buf, vIface_type); if(h->iface) { - if (ntop->registerInterface(h->iface)) + if(ntop->registerInterface(h->iface)) ntop->initInterface(h->iface); h->iface->allocateStructures(); h->iface->setDynamicInterface(); + h->iface->startPacketPolling(); /* Won't actually start a thread, just mark this interface as running */ HASH_ADD_INT(flowHashing, criteria, h); numVirtualInterfaces++; ntop->getRedis()->set(CONST_STR_RELOAD_LISTS, (const char * const)"1"); @@ -1084,13 +1085,11 @@ NetworkInterface* NetworkInterface::getSubInterface(u_int32_t criteria, bool par void NetworkInterface::processFlow(ParsedFlow *zflow, bool zmq_flow) { bool src2dst_direction, new_flow; Flow *flow; - ndpi_protocol p; + ndpi_protocol p = Flow::ndpiUnknownProtocol; time_t now = time(NULL); Mac *srcMac = NULL, *dstMac = NULL; IpAddress srcIP, dstIP; - memset(&p, 0, sizeof(p)); - if(zmq_flow) { /* In ZMQ flows we need to fix the clock drift */