1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

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
This commit is contained in:
Xin LI 2012-04-02 07:42:17 +00:00
parent 1f0fc486fa
commit 32ffd2336c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=233770
2 changed files with 0 additions and 4 deletions

View File

@ -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) {

View File

@ -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) {