OpenBSD DHCP bogus server name
Posted by creining | Filed under Linux/BSD
My OpenBSD firewall is sometimes too secure for it’s own good. I say that kiddingly of course. Here’s the deal, I am on an Ameritech DSL network that uses DHCP. My OpenBSD box sent out a DHCP request as normal in order to obtain a lease, but dhclient complained about “bogus server name”. Well I break out tcpdump and see that the Ameritech’s DHCP server is sending an offer back that has “Cayman3000/881485″ in the servername field. OpenBSD’s dhclient is pretty darn strict about what it will accept for this value…it must be alphanumeric without spaces and may contain periods and hyphens, but not at the start or end. So, in short, it must look like a hostname. In order to fix this I had to change the res_hnok() function in dhclient.c to make it return 1 (ok) unconditionally. This makes dhclient accept any kind of host name in an offer. I figured this solution was much easier then requesting Ameritech to changer their router settings
Comments are closed.