Zeal-Operating-System / ZealOS

The Zeal Operating System is a modernized fork of the 64-bit Temple Operating System, TempleOS.
https://zealos.net
The Unlicense
1.47k stars 68 forks source link

Figure Out eth Length #151

Closed retu2libc closed 7 months ago

retu2libc commented 7 months ago

There's a point in EthernetFrameParse where we just have the line:

frame_out->length    = length - ETHERNET_MAC_HEADER_LENGTH - 4;

Which as far as I can tell is never right. I'm contemplating opening a PR to remove the -4 since it seems to break all networking to the point where Zeal can't even respond to ARPs properly. If someone could shed some history on why this was like this it would be much appreciated. For reference I'm just using the basic virtio network device model for my nic in libvirt. On the cool side fixing this seems to make networking "just work" with my host.

retu2libc commented 7 months ago

So the extra 4 bytes are the FCS field. In the PCNet driver for 802.3 packets we can set ASTRP_RCV and be done with it. This doesn't work for Ethernet II packets though...