]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Log an error message if the configured IP address is invalid
authorKin-Wai Koo <glug71@gmail.com>
Tue, 22 Jan 2019 06:40:40 +0000 (14:40 +0800)
committerJaroslav Kysela <perex@perex.cz>
Mon, 4 Feb 2019 10:07:17 +0000 (11:07 +0100)
src/input/mpegts/tvhdhomerun/tvhdhomerun.c
src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c

index 4f17d0ef851bb81c5daf3b3c97f336f03ab8ef8a..58dec51ab39aaf9ee6163727601ef1722411f11a 100644 (file)
@@ -393,7 +393,7 @@ tvhdhomerun_ip( void )
   if (inet_pton(AF_INET, config.hdhomerun_ip, &ip))
     ip = ntohl(ip);
   else
-    tvhwarn(LS_TVHDHOMERUN, "Could not parse IP address %s", config.hdhomerun_ip);
+    tvherror(LS_TVHDHOMERUN, "Could not parse IP address %s", config.hdhomerun_ip);
 
   return ip;
 }
index b1d6c78138746ee875a1c2d4bf365aa95b52fe18..7d1452960a069ee88a371aaf7e9916241045e64f 100644 (file)
@@ -93,11 +93,12 @@ tvhdhomerun_frontend_input_thread ( void *aux )
 
   /* local IP */
   /* TODO: this is nasty */
-  local_ip = hdhomerun_device_get_local_machine_addr(hfe->hf_hdhomerun_tuner);
-  if ((*config.local_ip != 0) && inet_pton(AF_INET, config.local_ip, &local_ip))
-  {
+  if (*config.local_ip == 0)
+    local_ip = hdhomerun_device_get_local_machine_addr(hfe->hf_hdhomerun_tuner);
+  else if (inet_pton(AF_INET, config.local_ip, &local_ip))
     local_ip = ntohl(local_ip);
-  }
+  else
+    tvherror(LS_TVHDHOMERUN, "failed to parse local IP (%s)", config.local_ip);
 
   /* first setup a local socket for the device to stream to */
   sockfd = tvh_socket(AF_INET, SOCK_DGRAM, 0);