2023-05-09

Some progress update on kdhcp.

The DHCP server is coming along. I can read DHCP discovery requests; I got through the core DHCP options. I've elected to log and skip any unknown options.

I also got the pools working, and I can get pick a valid address. I have a duplicate limbo-address bug happening right now because I don't store the hardware address. This shows up right now because I'm not responding to discovery requests, so subsequent requests by the same machine will get different IPs. I think I'll write an "AddrForHardware" function (method) that will return the IP address associated with a hardware address - and also need to make sure that resetting a lease clears out the hardware address.

I still need to kick off a loop that updates the leases, though I guess I really only need to do that on pool updates.

One thing that I spent some time doing is dusting off my goutils library. I'd forgotten how much stuff I had in there, and ended up rewriting some of the functionality. I guess that's what happens when you don't write your own code for a while.

github.com/AlDanial/cloc v 1.90  T=0.06 s (1952.1 files/s, 144359.7 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Go                              71           1328            583           6088
Bazel                           47             88              0            813
Markdown                         3             10              0             38
-------------------------------------------------------------------------------
SUM:                           121           1426            583           6939
-------------------------------------------------------------------------------

I also took some time to port some of the code from CFSSL - one of the things I didn't like about how CFSSL ended up was how bloated it became. I also converted it over to Bazel, because I need to get better at Bazel for work (kdhcp also uses Bazel!).

One of the things I also need to do is set up my own package server - which I'll do when the X230 comes this week (need a secure signing system). I haven't found any good ways to do that with Bazel yet, so I may keep a shadow Make-based system going for a little bit.


Tags: