1
This commit is contained in:
1 parent
4b792de7b8
commit
52a4f853a6
1 file changed
+9
-8
+9
-8
@@ -60,6 +60,15 @@ static void tun_read_callback(int fd, void* user_arg)
|
||||
pkt->dgram = packet_data;
|
||||
pkt->len = nread + 1;
|
||||
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_TUN, "Read %zd bytes from TUN %s", nread + 1, tun->ifname);
|
||||
if (debug_should_output(DEBUG_LEVEL_DEBUG, DEBUG_CATEGORY_TUN)) {
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_TUN, "[TUN->] %s", dump_ip_packet_to_buffer(packet_data + 1, nread));
|
||||
}
|
||||
|
||||
// Update statistics
|
||||
tun->bytes_read += nread + 1;
|
||||
tun->packets_read++;
|
||||
|
||||
// Add to output queue (TUN → routing)
|
||||
if (queue_data_put(tun->output_queue, pkt) != 0) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_TUN, "Failed to add packet to output queue");
|
||||
@@ -68,14 +77,6 @@ static void tun_read_callback(int fd, void* user_arg)
|
||||
tun->read_errors++;
|
||||
return;
|
||||
}
|
||||
|
||||
// Update statistics
|
||||
tun->bytes_read += nread + 1;
|
||||
tun->packets_read++;
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_TUN, "Read %zd bytes from TUN %s", nread + 1, tun->ifname);
|
||||
if (debug_should_output(DEBUG_LEVEL_DEBUG, DEBUG_CATEGORY_TUN)) {
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_TUN, "[TUN->] %s", dump_ip_packet_to_buffer(packet_data + 1, nread));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user