diff options
author | delphij <delphij@FreeBSD.org> | 2012-04-02 07:42:17 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2012-04-02 07:42:17 +0000 |
commit | 6dfa60e0bf7108729fa98dcc5d5a4f38a306ea03 (patch) | |
tree | 4e1b3b2e9c7b45fef6e66376253f17cdeb833de8 /lib/libc | |
parent | c106dff7dbd04affd8be53b10583b3b341ca6e59 (diff) | |
download | FreeBSD-src-6dfa60e0bf7108729fa98dcc5d5a4f38a306ea03.zip FreeBSD-src-6dfa60e0bf7108729fa98dcc5d5a4f38a306ea03.tar.gz |
Eliminate two cases of unwanted strncpy(). The name is not required
by the current code, and the results would get overwritten anyway
by subsequent memset().
Reviewed by: ume
MFC after: 1 month
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 2 | ||||
-rw-r--r-- | lib/libc/net/name6.c | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 37f09f8..8083c39 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -847,8 +847,6 @@ set_source(struct ai_order *aio, struct policyhead *ph) struct in6_ifreq ifr6; u_int32_t flags6; - /* XXX: interface name should not be hardcoded */ - strncpy(ifr6.ifr_name, "lo0", sizeof(ifr6.ifr_name)); memset(&ifr6, 0, sizeof(ifr6)); memcpy(&ifr6.ifr_addr, ai.ai_addr, ai.ai_addrlen); if (_ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == 0) { diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c index 4864bf4..0031f46 100644 --- a/lib/libc/net/name6.c +++ b/lib/libc/net/name6.c @@ -884,8 +884,6 @@ set_source(struct hp_order *aio, struct policyhead *ph) struct in6_ifreq ifr6; u_int32_t flags6; - /* XXX: interface name should not be hardcoded */ - strncpy(ifr6.ifr_name, "lo0", sizeof(ifr6.ifr_name)); memset(&ifr6, 0, sizeof(ifr6)); memcpy(&ifr6.ifr_addr, &ss, ss.ss_len); if (_ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == 0) { |