smoltcp-rs / smoltcp

a smol tcp/ip stack
BSD Zero Clause License
3.79k stars 427 forks source link

Convert DHCP client to a socket #446

Closed Dirbaio closed 3 years ago

Dirbaio commented 3 years ago

Currently the DHCP client uses RawSocket to send/receive packets. The RawSocket needs TX and RX buffers, which need to be 900 + 600 bytes = 1.5KB.

If the DHCP client could send and receive packets "on the fly", inside the Interface poll loop, it would use 1.5KB less of RAM.

The way to do this is make the DHCP client be a new socket type.

Thoughts? @whitequark

whitequark commented 3 years ago

The way to do this is make the DHCP client be a new socket type.

I entirely agree with this, this is how I would have probably implemented it.