DHCP clients by default send a fair chunk of data which can identify you to the local DHCP server. In return they provide you with a stable IP address and configuration parameters.
At a bare minimum, the hardware address of the interface is sent- this is required to work.
So, how to solve this dilema of wanting total anonymity? The answer is to randomise the hardware address. This will happen when the carrier is down OR dhcpcd starts with the interface down.
Whilst developing Privilege Separation in dhcpcd, I had to come up with an IPC design for it. Of course, that involves creating structures.
So far, my structures in dhcpcd are long lived- or rather the scope is design to live outside of where it was created. As such they are created on the heap and are at the mercy of malloc. Generally I use calloc so that the whole area is inited to zero as uninitialised memory is bad.
So, dhcpcd was added to DragonFlyBSD almost a year ago. Recently I’ve become a DragonFlyBSD committer with the express purpose of easing dhcpcd into the role of the default DHCP client.
All of the really needed kernel improvements are now in and dhcpcd doesn’t log any more compile warnings, but there is more work to be done such as RFC 5227 support, restarting DaD on link state up and denying the use of an address until validated.
open_memstream is one of the more important functions added to POSIX libc of late. It’s so important because it makes the generation of strings really easy- you no longer need to care about allocating the right amount of memory as the library will do it for you. Now, there’s many functions that already help with this, such as asprintf but that’s not standard and if you want to create many strings in one area you still need to care about the size of the area.
Pretty much every piece of software I’ve seen uses a list of objects. When you need to easily grow and shrink this list easily you then need something like a Linked List. dhcpcd has used very popular and widely available BSD based queue(3), specifically a tailq. The main advantages of this type of list are:
Very low extra memory needed for it’s implementation Fast at insertion and removal operation- both are O(1) However, it’s just a list.