Bug 514700 - PTP should use getaddrinfo() instead of gethostbyname()
Summary: PTP should use getaddrinfo() instead of gethostbyname()
Status: NEW
Alias: None
Product: PTP
Classification: Tools
Component: Core (show other bugs)
Version: 9.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-04 08:09 EDT by Mat Booth CLA
Modified: 2017-04-04 08:09 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mat Booth CLA 2017-04-04 08:09:49 EDT
As noted in both MSDN [1] and in Linux libc man pages [2], the gethostbyname() functions are deprecated and applications should be ported to use getaddrinfo() instead.

[1] https://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx
[2] http://man7.org/linux/man-pages/man3/gethostbyname.3.html

The primary reason for this is that some implementations of gethostbyname() function do not support IPv6 (Windows in particular does not and the libc interface does not guarantee it) so in order to get full support of IPv4 and IPv6, applications should instead use getaddrinfo().

gethostbyname is used in at least the following places:

core/org.eclipse.ptp.proxy/src/proxy_tcp_clnt.c
core/org.eclipse.ptp.proxy/src/proxy_tcp_svr.c