1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Remove inet_ntoa() from the kernel

inet_ntoa() cannot be used safely in a multithreaded environment
because it uses a static local buffer.  Remove it from the kernel.

Suggested by:	glebius, emaste
Reviewed by:	gnn
MFC after:	never
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D9625
This commit is contained in:
Eric van Gyzen 2017-02-16 20:50:01 +00:00
parent 8144690af4
commit 922193e7ff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313822
2 changed files with 0 additions and 15 deletions

View File

@ -35,20 +35,6 @@ __FBSDID("$FreeBSD$");
#include <netinet/in.h>
char *
inet_ntoa(struct in_addr ina)
{
static char buf[4*sizeof "123"];
unsigned char *ucp = (unsigned char *)&ina;
sprintf(buf, "%d.%d.%d.%d",
ucp[0] & 0xff,
ucp[1] & 0xff,
ucp[2] & 0xff,
ucp[3] & 0xff);
return buf;
}
char *
inet_ntoa_r(struct in_addr ina, char *buf)
{

View File

@ -646,7 +646,6 @@ int in_localaddr(struct in_addr);
int in_localip(struct in_addr);
int in_ifhasaddr(struct ifnet *, struct in_addr);
int inet_aton(const char *, struct in_addr *); /* in libkern */
char *inet_ntoa(struct in_addr); /* in libkern */
char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */
char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */
int inet_pton(int af, const char *, void *); /* in libkern */