[PATCH] 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>
---
 src/applet.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/applet.c b/src/applet.c
index 2929863d..cb9229cb 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) {
-- 
2.11.0



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