--- client/dhclient.c 2008-01-22 18:28:23.000000000 +0100 +++ client/dhclient.c.oden 2009-07-15 00:22:19.000000000 +0200 @@ -2512,8 +2512,15 @@ void script_write_params (client, prefix if (data.len > 3) { struct iaddr netmask, subnet, broadcast; - memcpy (netmask.iabuf, data.data, data.len); - netmask.len = data.len; + /* + * No matter the length of the subnet-mask option, + * use only the first four octets. Note that + * subnet-mask options longer than 4 octets are not + * in conformance with RFC 2132, but servers with this + * flaw do exist. + */ + memcpy(netmask.iabuf, data.data, 4); + netmask.len = 4; data_string_forget (&data, MDL); subnet = subnet_number (lease -> address, netmask);