December 14, 2022

BSD TCP/IP for Kyu - Progress report 12-14-2022 -- success

I awoke a couple of nights ago and immediately began thinking about how I was handling locking and race conditions. Almost immediately I came to a realization of how I was making a fundamental mistake. The next day I changed the two lines of code that were necessary and things have worked ever since. An interesting example I think of how our subconcious works on problems even when we are asleep. Another viewpoint might be that it pays to get knee deep into a problem, then walk away from it and give yourself time to think about it.

I am a bit reluctant to announce success. I do intend to do more testing, as follows:

Another topic is my "TODO" list. How much code cleanup do I want to tackle? If it works, why not leave well enough alone? I have many many printf statements, commented out and scattered through the code, should I delete them to make the code look cleaner. I may regret it if I do. There are also big chunks of BSD code that are commented out (typically by being surrounded by ifdef/notdef). Should I prune out all of this.

I had ideas about simplifying mbuf handling. My idea was to make the mbuf big (2048 bytes), which would means that external clusters would never be needed and that mbuf chains for a single packet would never be needed. This would also allow (but not require) a lot of code simplification.

It might be interesting to look at fairly recent versions of netbsd and/or freebsd to see what sort of changes have been made in the BSD code in those operating systems.


Have any comments? Questions? Drop me a line!

Kyu / [email protected]