diff options
author | Alistair Strachan <astrachan@google.com> | 2019-05-28 17:09:47 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-05-28 17:09:47 -0700 |
commit | c956cf9485aabf87854d778c504b89dfbd4f113e (patch) | |
tree | 5116604d4b0e995537cee174d9174a650307691a | |
parent | dbab6594bc99ab4026c051508af0bfe92487aef9 (diff) | |
parent | 7ea34f72130838330a8da5b0dd870943c873de44 (diff) | |
download | mtpd-c956cf9485aabf87854d778c504b89dfbd4f113e.tar.gz |
Merge "Try OPNS/OLAC before PPTP/L2TP"
am: 7ea34f7213
Change-Id: I598c09dbb46146c07e1703b0fccf85ed21b31ecb
-rw-r--r-- | l2tp.c | 11 | ||||
-rw-r--r-- | pptp.c | 11 |
2 files changed, 12 insertions, 10 deletions
@@ -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; } } @@ -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; } } |