Browse Source

ports that have no service-entry are now unknown

portServices are now only unavailable if the nmap-services file could not be read
Stefano Acquaviti 6 years ago
parent
commit
abd38a1514
1 changed files with 4 additions and 1 deletions
  1. 4 1
      code_boost/src/cxx/statistics_db.cpp

+ 4 - 1
code_boost/src/cxx/statistics_db.cpp

@@ -238,7 +238,10 @@ void statistics_db::writeStatisticsPorts(std::unordered_map<ipAddress_inOut_port
             ipAddress_inOut_port e = it->first;
 
             std::string portService = portServices[e.portNumber];
-            if(portService.empty()) {portService = "unavailable";}
+            if(portService.empty()) {
+                if(portServices[{0}] == "unavailable") {portService = "unavailable";}
+                else {portService = "unknown";}
+            }
 
             query.bind(1, e.ipAddress);
             query.bind(2, e.trafficDirection);