gethostbyname() can't handle IPv6. Despite this fact it seems worth of nothing to check whether gethostbyname() really returned AF_INET or not. And that's what attached patch does, resp. in case IPv6 is returned then ipmitool shoud/will terminate.