A hexagonal prism has a height of 6 units and a regular hexagonal base with a side length of 4 units. What is the length of the longest segment that can fit inside this prism?