delete check_sum function and moved its logic inside tcp_syn #13

Merged
dr-wh0 merged 4 commits from my_tcp_syn into dev 2025-04-08 01:48:15 +03:00
1 changed files with 3 additions and 1 deletions
Showing only changes of commit f080b7fab6 - Show all commits

View File

@ -472,6 +472,9 @@ int my_tcp_syn() {
pseudo_header = nullptr; pseudo_header = nullptr;
temp_buf = nullptr; temp_buf = nullptr;
packet = nullptr; packet = nullptr;
checksum_ptr = 0;
checksum_sum = 0;
checksum_len = 0;
// === Основная логика процедуры === // === Основная логика процедуры ===
// 1. Создание raw-сокета // 1. Создание raw-сокета
@ -522,7 +525,6 @@ int my_tcp_syn() {
// Встроенный расчет контрольной суммы // Встроенный расчет контрольной суммы
Urmipie marked this conversation as resolved
Review

checksum_ptr, checksum_sum, checksum_len необходимо инициализировать сначала

checksum_ptr, checksum_sum, checksum_len необходимо инициализировать сначала
Review

Они инициализированы на строке 459

Они инициализированы на строке 459
checksum_ptr = (uint16_t *)temp_buf; checksum_ptr = (uint16_t *)temp_buf;
checksum_sum = 0;
checksum_len = sizeof(temp_buf); checksum_len = sizeof(temp_buf);
while (checksum_len > 1) { while (checksum_len > 1) {