mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-22 11:17:19 +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:
parent
1f0fc486fa
commit
32ffd2336c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=233770
@ -847,8 +847,6 @@ set_source(struct ai_order *aio, struct policyhead *ph)
|
|||||||
struct in6_ifreq ifr6;
|
struct in6_ifreq ifr6;
|
||||||
u_int32_t flags6;
|
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));
|
memset(&ifr6, 0, sizeof(ifr6));
|
||||||
memcpy(&ifr6.ifr_addr, ai.ai_addr, ai.ai_addrlen);
|
memcpy(&ifr6.ifr_addr, ai.ai_addr, ai.ai_addrlen);
|
||||||
if (_ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == 0) {
|
if (_ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == 0) {
|
||||||
|
@ -884,8 +884,6 @@ set_source(struct hp_order *aio, struct policyhead *ph)
|
|||||||
struct in6_ifreq ifr6;
|
struct in6_ifreq ifr6;
|
||||||
u_int32_t flags6;
|
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));
|
memset(&ifr6, 0, sizeof(ifr6));
|
||||||
memcpy(&ifr6.ifr_addr, &ss, ss.ss_len);
|
memcpy(&ifr6.ifr_addr, &ss, ss.ss_len);
|
||||||
if (_ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == 0) {
|
if (_ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user