From bcb643f77342b1b3de74df04bee5a71b90be7097 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 12 Dec 2005 19:49:48 +0000 Subject: [PATCH] =?utf8?q?Arreglo=20el=20maldito=20bug=20que=20tiraba=20lo?= =?utf8?q?s=20paquetes=20con=20tama=C3=B1o=20par.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/udp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/udp.c b/src/udp.c index 09b9bfc..68c457d 100644 --- a/src/udp.c +++ b/src/udp.c @@ -90,7 +90,7 @@ byte udp_read_byte() bool udp_checksum_ok() { // Verifico si falta sumar algo (UDP debe sumar de a un word) - if (byte_count == (udp_dgram_len - UDP_HEADER_SIZE)) + if (byte_count % 2) sum(WORD(last_byte, 0x00)); // Relleno el byte que falta con 0x00 return !(uint16)~checksum; } @@ -146,7 +146,7 @@ void udp_write_byte(byte b) void udp_write_checksum(byte offset) { // Verifico si falta sumar algo (UDP debe sumar de a un word) - if (byte_count == (udp_dgram_len - UDP_HEADER_SIZE)) + if (byte_count % 2) sum(WORD(last_byte, 0x00)); // Relleno el byte que falta con 0x00 // Escribo checksum en el buffer de la placa de red netdev_write_start_at(offset + 6, 2); // 6 bytes de offset hasta el checksum -- 2.43.0