summaryrefslogtreecommitdiff
path: root/kernel/network/ethernet.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-11-22 00:47:55 +0100
committerAnton Kling <anton@kling.gg>2023-11-22 00:47:55 +0100
commitf3c7d7fbdea1f2bac81909116ddb747a1f8abdf5 (patch)
tree62a1d998ce11bf4db4343f69dea4e8d231191e48 /kernel/network/ethernet.c
parent24f81104f5ff9cb4ab7db766c53f77fe0e5b86cc (diff)
Meta: Cleanup of header files such that they are partially shared
The /include directory contains definitons that both the kernel and libc need to be in sync.
Diffstat (limited to 'kernel/network/ethernet.c')
-rw-r--r--kernel/network/ethernet.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/kernel/network/ethernet.c b/kernel/network/ethernet.c
index 5cf1a54..6255ecb 100644
--- a/kernel/network/ethernet.c
+++ b/kernel/network/ethernet.c
@@ -50,10 +50,6 @@ void handle_ethernet(const u8 *packet, u64 packet_length) {
packet += sizeof(struct ETHERNET_HEADER);
const u8 *payload = packet;
packet += packet_length - sizeof(struct ETHERNET_HEADER);
- u32 crc = *((u32 *)packet - 1);
- kprintf("PACKET crc: %x\n", crc);
- kprintf("OUR OWN CALCULATED crc: %x\n",
- crc32((const char *)eth_header, (packet_length - 4)));
u16 type = ntohs(eth_header->type);
switch (type) {
@@ -84,10 +80,8 @@ void send_ethernet_packet(u8 mac_dst[6], u16 type, u8 *payload,
memcpy(eth_header->mac_dst, mac_dst, sizeof(u8[6]));
get_mac_address(eth_header->mac_src);
eth_header->type = htons(type);
- *(u32 *)(buffer) =
- htonl(crc32((const char *)buffer_start, buffer_size - 4));
+ *(u32 *)(buffer) = htonl(crc32((const char *)buffer_start, buffer_size - 4));
assert(rtl8139_send_data(buffer_start, buffer_size));
kfree(buffer_start);
- kprintf("sent data\n");
}