Skip to content

Commit 650dd3e

Browse files
committed
opal/if/linux_ipv6: unify gethostname() call behavior
Unfortunately, #6797 was merged before all feedback was received (39b799d). This PR is a minor addendum to that commit. This PR simply removes a meaningless `= {0}` operation. The use of gethostname() here -- and many other places in the code base -- is technically unsafe. See #6801 for a further description of the issue and a suggested fix. But the risk is quite low; real-world hostnames are usually much shorter than OPAL_MAXHOSTNAMELEN. Hence, this PR just removes the meaningless operation and leaves a real fix for gethostname() usage to a potential future PR. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 29468ec commit 650dd3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opal/mca/if/linux_ipv6/if_linux_ipv6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static int if_linux_ipv6_open(void)
127127
opal_if_t *intf;
128128

129129
if (!hexdecode(addrhex, a6.s6_addr, sizeof a6.s6_addr)) {
130-
char hostname[OPAL_MAXHOSTNAMELEN] = {0};
130+
char hostname[OPAL_MAXHOSTNAMELEN];
131131
gethostname(hostname, sizeof(hostname));
132132
opal_show_help("help-opal-if-linux-ipv6.txt",
133133
"fail to parse if_inet6", true,

0 commit comments

Comments
 (0)