* > /dev/null

Home | Tags | Archives

Monday, November 13 2017

Technical dept, part II: SO_REUSEPORT - more than meets the eye?

This actually might become a recurring thing for me, since I have the time and inclination, I've decided to give this idea the tentative term technical dept, so without further ado, here's part II:

Prompted by a a conversation on Twitter I happened upon, I went digging for the original purpose the SO_REUSEPORT, as despite the fact that it's being used very effectively by NGINX, it's not something that seems to have been a worry not that long ago. Turning to my, at this point, trusty old friend source revisioning, to my surprise I found that the feature is much, much older than I expected. It dates back at least to July, 1992 when Andrew Cherenson at SGI used it to fix a bug for multicast, not long after TCP/IP was added and reworked in BSD4.1 and BSD4.2 respectively.

Which also brings up another rather salient point - it's very important to document why a change was made. Andrew seems to have intended this feature solely for a bugfix, but now look at all the interesting ways it's being used.

It is also a bit curious to me that it's a feature that was only added to Linux in 2013 - making it more than 20 years in the making.

jmg@ helpfully pointed me towards an in-depth technical coverage of what it, and the related SO_REUSEADDR, does - and I think it merits reading.

Continue reading»

Saturday, November 11 2017

Technical dept, part I: On the origin of die_you_gravy_sucking_pig_dog()

​A little while ago brnrd@ on Twitter brought up the function, mentioned in the title of this post, which has been part of the BSD source tree in /usr/src/sbin/shutdown/shutdown.c for quite a while, and since I've always been fond of Steve Martins comedy routines and also like looking through source code that's older than most peoples experience with computers, I decided I'd go look for its origins.

After a bit of digging around, I decided to send Keith Bostic an email asking whether he lay claim to it.

On Thu, Oct 26, 2017 at 22:23, Keith Bostic wrote:

Wow, that's from a long time ago. :)

Yeah, that was probably me.

I was always a big Steve Martin fan.


So here it is, saved for posterity.

Make of it what you will, but I think it's fascinating that code that old still lives to this day.

Continue reading»

Saturday, January 24 2015

A little oddity about pcap filter sequences

A discusson on efnets #bsd-dk today revealed an oddity about the filter sequence that tcpdump uses when libpcap has been compiled with vlan support, and you are looking to filter vlans in or out of your output. It turns out that vlan statements should seemingly always be specified at the beginning of the statement, in the following fashion:

tcpdump -i trunk1 vlan 42 and not port 80

If the statement is reversed, ie. not port 80 and vlan 42, you can’t reliably expect an output on all systems.

Another interesting thing about this, is that while plenty of site demonstrate vlan support, the filter sequence is hardly ever brought up.

Continue reading»

Wednesday, December 3 2014

Thoughts on FreeBSD 10.1 x64, VirtualBox and Hyper-V

Today I had to do a bit of testing with FreeBSD and, since I wasn’t using my workstation for anything in particular, I threw FreeBSD 10.1 ×64 in VirtualBox. What’s interesting about this is that nowadays it only takes about 10 minutes to be up and running with XDM and xfce installed through pkg. Quite a pleasent surprise

One interesting issue I had was that because I had at one point installed and then removed Hyper-V, it appears that it isn’t completely removed and it is necessary to manually disable the VT-x locking that Hyper-V does at boot-time by running the following command:

bcdedit /set hypervisorlaunchtype off

Continue reading»