Skip to content

Glorious Network Stack Rewrite (using my own brain and hands this time) - #188

Open
FlareCoding wants to merge 20 commits into
masterfrom
pr/albert-network-stack-rewrite
Open

Glorious Network Stack Rewrite (using my own brain and hands this time)#188
FlareCoding wants to merge 20 commits into
masterfrom
pr/albert-network-stack-rewrite

Conversation

@FlareCoding

@FlareCoding FlareCoding commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Note

High Risk
Full rewrite of kernel networking and driver/stack boundaries; only virtio-net is registered, so hardware Ethernet paths lose DHCP and stack connectivity until re-integrated.

Overview
Replaces the old netif callback + deferred TX/DHCP model with a packet / interface stack: drivers hand frames in through receive(), layers use ethipv4 → ICMP/ARP, and netstkd ages the ARP table. Virtio-net is the only driver wired end-to-end today—it subclasses net::interface, registers as ethN, copies RX into packets, and transmits via transmit(packet*) with a temporary QEMU static IPv4 config.

BCM GENET and RTL8168 are stripped back to link-layer only: embedded m_mac, instance transmit(frame), no register_netif, no DHCP/link callbacks, and RX no longer feeds the stack (placeholder until a protocol stack attaches). The monolithic inet_socket, dhcp, loopback, and ethernet modules are removed in favor of eth, typed ipv4/eth addresses, refactored checksum/byteorder, non-blocking ARP with pending packet queues, and ICMP ping sockets via inet::create_socket. UDP/TCP are not carried forward yet—IPv4 logs and drops them. Style rules add documentation voice guidance using interface.h as the reference.

Reviewed by Cursor Bugbot for commit d876ab5. Bugbot is set up for automated code reviews on this repo. Configure here.

cursor[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as off-topic.

cursor[bot]

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant