Try OPNS/OLAC before PPTP/L2TP
am: a378c558d6

Change-Id: I6424dfadcd77874edd1095066b1ec612b32eeea1
diff --git a/l2tp.c b/l2tp.c
index 1d6171e..ae6088d 100644
--- a/l2tp.c
+++ b/l2tp.c
@@ -354,19 +354,20 @@
 }
 
 /**
- * Check if upstream kernel implementation is enabled.
+ * Check if upstream kernel implementation of L2TP should be used.
  *
- * @return true if upstream L2TP is enabled in kernel and false otherwise
+ * @return true If upstream L2TP should be used, which is the case if
+ *              the obsolete OLAC feature is not available.
  */
 static bool check_ol2tp(void)
 {
-    int fd = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_OL2TP);
+    int fd = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_OLAC);
 
     if (fd < 0) {
-        return false;
+        return true;
     } else {
         close(fd);
-        return true;
+        return false;
     }
 }
 
diff --git a/pptp.c b/pptp.c
index 80eb24a..7a58a27 100644
--- a/pptp.c
+++ b/pptp.c
@@ -237,19 +237,20 @@
 }
 
 /**
- * Check if upstream kernel implementation is enabled.
+ * Check if upstream kernel implementation of PPTP should be used.
  *
- * @return true if upstream PPTP is enabled in kernel and false otherwise
+ * @return true If upstream PPTP should be used, which is the case if
+ *              the obsolete OPNS feature is not available.
  */
 static bool check_pptp(void)
 {
-    int fd = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_PPTP);
+    int fd = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_OPNS);
 
     if (fd < 0) {
-        return false;
+        return true;
     } else {
         close(fd);
-        return true;
+        return false;
     }
 }