- logger(LOG_ERR, "Error while reading from %s %s: %s", device_info, device, strerror(errno));
- running = false;
+ logger(DEBUG_ALWAYS, LOG_ERR, "Error while reading from %s %s: %s", device_info, device, strerror(errno));
+ event_exit();
+ return false;
+ }
+
+ if(lenin == 1) {
+ logger(DEBUG_TRAFFIC, LOG_DEBUG,
+ "Dropped a packet received from %s - the sender was not allowed to send that packet.", device_info);
+ return false;
+ }
+
+ if(lenin < 14) {
+ logger(DEBUG_TRAFFIC, LOG_DEBUG,
+ "Received an invalid packet from %s - packet shorter than an ethernet header).", device_info);