dhcp4: use a helper for netmask/cidr conversions