summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Strachan <astrachan@google.com>2019-05-28 17:24:46 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-05-28 17:24:46 -0700
commitfa917291a83ee404ec92603178bd8e7c954d024f (patch)
tree5116604d4b0e995537cee174d9174a650307691a
parent82a02d946a4bf7da11dc0c6be3c4b0b2d52bd378 (diff)
parent1b5fc73ae98d5e3b7d2c1f10d9dcbc2749355d3e (diff)
downloadmtpd-fa917291a83ee404ec92603178bd8e7c954d024f.tar.gz
Merge "Try OPNS/OLAC before PPTP/L2TP" am: 7ea34f7213 am: c956cf9485
am: 1b5fc73ae9 Change-Id: I71bcf23d12c1a3dfbc2860a68dcd70764d38d813
-rw-r--r--l2tp.c11
-rw-r--r--pptp.c11
2 files changed, 12 insertions, 10 deletions
diff --git a/l2tp.c b/l2tp.c
index 1d6171e..ae6088d 100644
--- a/l2tp.c
+++ b/l2tp.c
@@ -354,19 +354,20 @@ static int l2tp_connect(char **arguments)
}
/**
- * 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 @@ static int pptp_connect(char **arguments)
}
/**
- * 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;
}
}