svn commit: r234903 - stable/9/lib/libc/net

Xin LI delphij at FreeBSD.org
Wed May 2 00:30:31 UTC 2012


Author: delphij
Date: Wed May  2 00:30:30 2012
New Revision: 234903
URL: http://svn.freebsd.org/changeset/base/234903

Log:
  MFC r233770:
  
  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

Modified:
  stable/9/lib/libc/net/getaddrinfo.c
  stable/9/lib/libc/net/name6.c
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/net/getaddrinfo.c
==============================================================================
--- stable/9/lib/libc/net/getaddrinfo.c	Tue May  1 23:46:18 2012	(r234902)
+++ stable/9/lib/libc/net/getaddrinfo.c	Wed May  2 00:30:30 2012	(r234903)
@@ -847,8 +847,6 @@ set_source(struct ai_order *aio, struct 
 		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) {

Modified: stable/9/lib/libc/net/name6.c
==============================================================================
--- stable/9/lib/libc/net/name6.c	Tue May  1 23:46:18 2012	(r234902)
+++ stable/9/lib/libc/net/name6.c	Wed May  2 00:30:30 2012	(r234903)
@@ -884,8 +884,6 @@ set_source(struct hp_order *aio, struct 
 		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) {


More information about the svn-src-stable-9 mailing list