Skip to content

Commit e3ed222

Browse files
committed
Revert "use abstract namespace"
This reverts commit 5d4db4f.
1 parent 5d4db4f commit e3ed222

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/android.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ int protect_socket(int fd) {
6161
setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval));
6262
setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(struct timeval));
6363

64-
const char path[] = "#shadowsocks_protect";
64+
const char path[] = "/data/data/com.github.shadowsocks/protect_path";
6565

6666
memset(&addr, 0, sizeof(addr));
6767
addr.sun_family = AF_UNIX;
6868
strncpy(addr.sun_path, path, sizeof(addr.sun_path)-1);
69-
addr.sun_path[0] = 0;
70-
socklen_t len = strlen(path) + offsetof(struct sockaddr_un, sun_path);
7169

72-
if (connect(sock, (struct sockaddr*)&addr, len) == -1) {
70+
if (connect(sock, (struct sockaddr*)&addr, sizeof(addr)) == -1) {
7371
LOGE("[android] connect() failed: %s (socket fd = %d)\n", strerror(errno), sock);
7472
close(sock);
7573
return -1;

0 commit comments

Comments
 (0)