Blame SOURCES/Prevent-monitoring-all-interfaces-after-change-of-ot.patch

622bbc
From b51d777b733f76844c3a1c72221a76ace460ab26 Mon Sep 17 00:00:00 2001
622bbc
From: Ondrej Holy <oholy@redhat.com>
622bbc
Date: Fri, 24 Aug 2018 14:37:11 +0200
622bbc
Subject: [PATCH 1/3] Prevent monitoring all interfaces after change of other
622bbc
 props
622bbc
622bbc
Commit bfa1432 prevents monitoring all interfaces if invalid interface
622bbc
is provided, but it works only in some cases, because the invalid
622bbc
interface is not remebered and for example consequent change of port
622bbc
will cause that all interfaces are monitored again. Remember the invalid
622bbc
interface to prevent monitoring all interfaces even after change of
622bbc
other properties...
622bbc
622bbc
https://bugzilla.gnome.org/show_bug.cgi?id=796349
622bbc
---
622bbc
 server/libvncserver/sockets.c | 9 +++------
622bbc
 1 file changed, 3 insertions(+), 6 deletions(-)
622bbc
622bbc
diff --git a/server/libvncserver/sockets.c b/server/libvncserver/sockets.c
622bbc
index 45df6d5..ee755eb 100644
622bbc
--- a/server/libvncserver/sockets.c
622bbc
+++ b/server/libvncserver/sockets.c
622bbc
@@ -748,12 +748,9 @@ rfbSetNetworkInterface(rfbScreenInfoPtr rfbScreen, const char *netIface)
622bbc
     rfbScreen->rfbListenSockTotal = 0;
622bbc
   }
622bbc
 
622bbc
-  if(netIface != NULL && strlen(netIface) > 0 && if_nametoindex(netIface) > 0) {
622bbc
-     rfbScreen->netIface = netIface;
622bbc
-  }
622bbc
-  else {
622bbc
-    rfbScreen->netIface = NULL;
622bbc
-    if(netIface != NULL && strlen(netIface) > 0) {
622bbc
+  if(netIface != NULL && strlen(netIface) > 0) {
622bbc
+    rfbScreen->netIface = netIface;
622bbc
+    if (if_nametoindex(netIface) == 0) {
622bbc
       rfbLog("(%s) is an invalid network interface\n", netIface);
622bbc
       return FALSE;
622bbc
     }
622bbc
-- 
622bbc
2.17.1
622bbc