Fixed a nasty network byte order bug.

This commit is contained in:
Rolf Ahrenberg 2013-03-17 01:18:58 +02:00
parent 0c6257e4ca
commit f30817677e
2 changed files with 3 additions and 2 deletions

View File

@ -203,3 +203,4 @@ VDR Plugin 'iptv' Revision History
2013-xx-xx: Version 1.2.2
- Enabled I/O throttling and tweaked buffer timeouts.
- Fixed a nasty network byte order bug.

View File

@ -93,7 +93,7 @@ bool cIptvSocket::CheckAddress(const char *addrP, in_addr_t *inAddrP)
{
if (inAddrP) {
// First try only the IP address
*inAddrP = htonl(inet_addr(addrP));
*inAddrP = inet_addr(addrP);
if (*inAddrP == htonl(INADDR_NONE)) {
debug("cIptvSocket::%s(%s): cannot convert to address", __FUNCTION__, addrP);
// It may be a host name, get the name
@ -104,7 +104,7 @@ bool cIptvSocket::CheckAddress(const char *addrP, in_addr_t *inAddrP)
strerror_r(h_errno, tmp, sizeof(tmp)));
return false;
}
*inAddrP = htonl(inet_addr(*host->h_addr_list));
*inAddrP = inet_addr(*host->h_addr_list);
}
return true;
}