diff options
author | Xin LI <delphij@FreeBSD.org> | 2012-04-02 07:42:17 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2012-04-02 07:42:17 +0000 |
commit | 32ffd2336cd9ba0e012ebbab8436d47816d6620e (patch) | |
tree | 4e1b3b2e9c7b45fef6e66376253f17cdeb833de8 | |
parent | 1f0fc486fa7ce055a298ff60949817e419bcd941 (diff) | |
download | src-32ffd2336cd9ba0e012ebbab8436d47816d6620e.tar.gz src-32ffd2336cd9ba0e012ebbab8436d47816d6620e.zip |
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
Notes
Notes:
svn path=/head/; revision=233770
-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 37f09f853e7e..8083c390b3b6 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 4864bf4a6f55..0031f462ffc2 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) { |