diff options
author | Robin Lee <rgl@google.com> | 2017-03-17 13:21:36 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-17 13:21:36 +0000 |
commit | cd787c027b6b1bf58c51c3b0887af6730f858efe (patch) | |
tree | 191f0973c98b20754bf97b1afd3a8c5b84930af6 | |
parent | 4532572d2c815c7af2660dda9eee05eda09e31a1 (diff) | |
parent | e80d1cfd58936fced61f096c7ab57393c2d4de98 (diff) | |
download | mtpd-cd787c027b6b1bf58c51c3b0887af6730f858efe.tar.gz |
Merge "Protect mtpd socket from VPN" am: de148c40d2
am: e80d1cfd58
Change-Id: I9648e9b3caee84267ae30d86fc99cf7c5ed5c1b5
-rw-r--r-- | Android.bp | 1 | ||||
-rw-r--r-- | mtpd.c | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -23,6 +23,7 @@ cc_binary { "libcrypto", "libcutils", "liblog", + "libnetd_client", ], cflags: ["-DANDROID_CHANGES"], init_rc: ["mtpd.rc"], @@ -35,6 +35,7 @@ #endif #include "mtpd.h" +#include "NetdClient.h" int the_socket = -1; @@ -295,6 +296,10 @@ void create_socket(int family, int type, char *server, char *port) exit(NETWORK_ERROR); } +#ifdef ANDROID_CHANGES + protectFromVpn(the_socket); +#endif + fcntl(the_socket, F_SETFD, FD_CLOEXEC); log_print(INFO, "Connection established (socket = %d)", the_socket); } |