[network-manager-applet] applet: use default active interface, even if it is of unsupported class



commit 35736dd2dfe05534e5e45d9e3cdddf3cabec840c
Author: Nikolay Martynov <mar kolya gmail com>
Date:   Tue May 16 23:15:47 2017 -0400

    applet: use default active interface, even if it is of unsupported class
    
    Currently if I have bond interface running as my default interface and
    I try to establish VPN connection I get route to VPN server added to
    physical ethernet interface - one of bond slaves. This makes no sense
    - that slave doesn't even have IP address, and obviously such VPN
    connection fails to work.
    
    The problem happanes because we try to determine what interface has
    default route and we skip all interfaces that we do not know
    about (i.e. anything that is not ethernet, wifi, wwan, modem and
    BT). Since bond is not on the list code skips it.
    
    It looks like code doesn't really care what type the 'default'
    interface is - so that check is really not nessesary. Removing that
    check fixes 'VPN with default route via bond' problem.
    
    Signed-off-by: Nikolay Martynov <mar kolya gmail com>
    
    https://mail.gnome.org/archives/networkmanager-list/2017-May/msg00042.html

 src/applet.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index 1bff838..4ac7fab 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -248,8 +248,12 @@ applet_get_default_active_connection (NMApplet *applet, NMDevice **device)
                        continue;
 
                candidate_dev = g_ptr_array_index (devices, 0);
-               if (!get_device_class (candidate_dev, applet))
-                       continue;
+
+               /* We have to return default connection/device even if they are of an
+                * unknown class - otherwise we may end up returning non
+                * default interface which has nothing to do with our default
+                * route, e.g. we may return slave ethernet when we have
+                * defult route going through bond */
 
                if (nm_active_connection_get_default (candidate)) {
                        if (!default_ac) {


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