Contributed by tj on from the you-saw-the-axe dept.
I don't usually get too involved with the network stack, but sometimes you find yourself at a network hackathon and have to go with the flow. With many developers working in the same area, it can be hard to find an appropriate project, but fortunately there are a few dusty corners in networking land that can be swept up without too much disturbance to others.
IPv6 is the future of networking. IPv6 has also been the future of networking for 20 years. As a result, a number of features have been proposed, implemented, then obsoleted, but the corresponding code never quite gets deleted. The IPsec stack has followed a somewhat similar trajectory.
I read through various networking headers in search of features that would normally be exposed to userland, but were instead guarded by ifdef _KERNEL. This identified a number of options for setsockopt() that had been officially retired from the API, but the kernel code retained to provide ABI compatibility during a transtion period. That transition occurred more than a decade ago. Binary programs from that era no longer run for many other reasons, and so we can delete support. It's only a small improvement, but it gradually reduces the amount of code that needs to be reviewed when making larger more important changes.
The ifconfig tool has a similar story. Long ago, it was possible to control transmission power for wireless devices. Presently, however, only the wi driver (a great driver in its day, but no longer relevant) supports this option. Trying to use the txpower command with a modern driver is likely to result in an error:
ifconfig: SIOCS80211TXPOWER: Invalid argument.
Some drivers, though, misleadingly claim to support this option. It's a knob you can turn, but it's not connected to the radio and has no effect. Better to remove it so that users are not confused and mislead into believing it does something.
Even longer ago, there was an option to support ethernet trailers. You can read RFC 893 for the details about how this enabled zero copy networking on a VAX with 512 byte hardware pages. This option was removed even before OpenBSD was founded, but nevertheless a fake option was left in ifconfig which printed a message. And a random assortment of drivers would set the NOTRAILERS flag, which ifconfig would dutifully support. But there is no behavioral difference to explain why rtw had this flag but urtw did not.
Returning to the present, I spent some time working on rebound. rebound is a simple DNS proxy meant to resolve some of the issues that occur with the current design of having every program directly query the network itself. I think it's nearing completion, but there are always more edge cases that need handling. For example, when one doesn't have any network configured, the libc resolver will immediately fail because the sendto() syscall will return an error. But when using a localhost proxy like rebound, that call will succeed, and rebound will experience the error. I initially treated all errors in rebound as transient. After all, UDP is lossy and I knew libc would retry after a timeout. But in this case, we don't want to retry after a timeout; we want to fail immediately to avoid long hangs. So now rebound detects this condition and responds with an empty packet to keep libc moving along.
I also looked at some diffs to malloc previously proposed by Daniel Micay which add a bit more integrity checking and use after free detection. We should be able to integrate these soon. And I continued some work leftover from the utf-8 hackathon. Ingo has taken over the coding efforts, so there's some good diffs to review and test. And it wouldn't be a hackathon if I didn't have to deal with at least one feature request for doas. :)
Thanks for the report! A legacy-free system is a happy system.
(Comments are closed)