Skip to content

Commit

Permalink
Update all software to use fi_host_is_localhost(), thus recognizing
Browse files Browse the repository at this point in the history
common IPv6 "localhost" strings.
  • Loading branch information
chu11 committed Jan 13, 2017
1 parent e30837c commit 511d839
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 1 addition & 3 deletions common/toolcommon/tool-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ ipmi_open (const char *progname,
goto cleanup;
}

if (hostname
&& strcasecmp (hostname, "localhost") != 0
&& strcmp (hostname, "127.0.0.1") != 0)
if (hostname && !fi_host_is_localhost (hostname))
{
if (common_args->driver_type == IPMI_DEVICE_LAN_2_0)
{
Expand Down
6 changes: 2 additions & 4 deletions ipmiseld/ipmiseld-ipmi-communication.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,13 @@ ipmiseld_ipmi_setup (ipmiseld_host_data_t *host_data)
goto cleanup;
}

if (host_data->hostname
&& strcasecmp (host_data->hostname, "localhost") != 0
&& strcmp (host_data->hostname, "127.0.0.1") != 0)
if (host_data->hostname && !fi_host_is_localhost (host_data->hostname))
{
if (common_args->driver_type == IPMI_DEVICE_LAN_2_0)
{
parse_get_freeipmi_outofband_2_0_flags (common_args->workaround_flags_outofband_2_0,
&workaround_flags);

if (ipmi_ctx_open_outofband_2_0 (host_data->host_poll->ipmi_ctx,
host_data->hostname,
common_args->username,
Expand Down
5 changes: 2 additions & 3 deletions libipmimonitoring/ipmi_monitoring_ipmi_communication.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "ipmi_monitoring_ipmi_communication.h"

#include "freeipmi-portability.h"
#include "fi_hostlist.h"

extern uint32_t _ipmi_monitoring_flags;

Expand Down Expand Up @@ -554,9 +555,7 @@ ipmi_monitoring_ipmi_communication_init (ipmi_monitoring_ctx_t c,
goto cleanup;
}

if (!hostname
|| !strcasecmp (hostname, "localhost")
|| !strcmp (hostname, "127.0.0.1"))
if (!hostname || fi_host_is_localhost (hostname))
{
if (_inband_init (c, config) < 0)
goto cleanup;
Expand Down

0 comments on commit 511d839

Please sign in to comment.