[vino/wip/oholy/invalid-interface: 1/3] Prevent monitoring all interfaces after change of other props



commit b51d777b733f76844c3a1c72221a76ace460ab26
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Aug 24 14:37:11 2018 +0200

    Prevent monitoring all interfaces after change of other props
    
    Commit bfa1432 prevents monitoring all interfaces if invalid interface
    is provided, but it works only in some cases, because the invalid
    interface is not remebered and for example consequent change of port
    will cause that all interfaces are monitored again. Remember the invalid
    interface to prevent monitoring all interfaces even after change of
    other properties...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=796349

 server/libvncserver/sockets.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/server/libvncserver/sockets.c b/server/libvncserver/sockets.c
index 45df6d5..ee755eb 100644
--- a/server/libvncserver/sockets.c
+++ b/server/libvncserver/sockets.c
@@ -748,12 +748,9 @@ rfbSetNetworkInterface(rfbScreenInfoPtr rfbScreen, const char *netIface)
     rfbScreen->rfbListenSockTotal = 0;
   }
 
-  if(netIface != NULL && strlen(netIface) > 0 && if_nametoindex(netIface) > 0) {
-     rfbScreen->netIface = netIface;
-  }
-  else {
-    rfbScreen->netIface = NULL;
-    if(netIface != NULL && strlen(netIface) > 0) {
+  if(netIface != NULL && strlen(netIface) > 0) {
+    rfbScreen->netIface = netIface;
+    if (if_nametoindex(netIface) == 0) {
       rfbLog("(%s) is an invalid network interface\n", netIface);
       return FALSE;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]