From f30817677e277826358f44dcfc89c6e20757bccd Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Sun, 17 Mar 2013 01:18:58 +0200 Subject: [PATCH] Fixed a nasty network byte order bug. --- HISTORY | 1 + socket.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index c548056..e5a5291 100644 --- a/HISTORY +++ b/HISTORY @@ -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. diff --git a/socket.c b/socket.c index 6d65b84..8cd29fa 100644 --- a/socket.c +++ b/socket.c @@ -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; }