Skip to content

Commit cdf8420

Browse files
author
chris
committed
o Move IPC file locations so the java app has permission.
1 parent 6d5e639 commit cdf8420

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

lispd_tuntap/lispconf/lispconf.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
#include <sys/un.h>
2626

27-
const int true = 1;
28-
const int false = 0;
29-
3027
#define MAX_MSG_LENGTH 1024
3128

3229
struct sockaddr_un server_sock;
3330
struct sockaddr_un client_sock;
3431
int dsock_fd, dclient_fd;
3532

33+
const int true = 1;
34+
const int false = 0;
35+
3636
/*
3737
* Globally reused socket parameters
3838
*/
@@ -276,7 +276,6 @@ int process_print_cache_responses(void)
276276
char *formatted_rloc = NULL;
277277
struct timeval uptime;
278278
struct timeval expiretime;
279-
int retries = 2;
280279
struct timeval tv;
281280

282281
tv.tv_sec = 1; /* 1 second timeout */
@@ -589,8 +588,8 @@ int process_print_db_responses(void)
589588
}
590589

591590
#define LISP_DCACHE_PATH_MAX 100
592-
const char *LispServerIPCFile = "/data/data/com.le.lispmon/lispd_ipc_server";
593-
const char *LispClientIPCFile = "/data/data/com.le.lispmon/lispd_ipc_client";
591+
const char *LispServerIPCFile = "/data/data/com.le.lispmontun/lispd_ipc_server";
592+
const char *LispClientIPCFile = "/data/data/com.le.lispmontun/lispd_ipc_client";
594593

595594
int make_dsock_addr(const char *dsock_name, struct sockaddr_un *dsock_addr)
596595
{
@@ -905,8 +904,6 @@ int main(int argc, char **argv)
905904

906905
struct gengetopt_args_info args_info;
907906

908-
int i;
909-
910907
/*
911908
* Parse command line options
912909
*/
@@ -943,25 +940,36 @@ int main(int argc, char **argv)
943940
if (args_info.add_entry_given) {
944941
add_entry(&args_info);
945942
close(dsock_fd);
943+
unlink(LispClientIPCFile);
944+
946945
exit(0);
947946
}
948947

949948
if (args_info.print_given) {
950949
send_print_command(&args_info);
950+
951951
close(dsock_fd);
952+
unlink(LispClientIPCFile);
953+
952954
exit(0);
953955
}
954956

955957
if (args_info.interface_given) {
956958
set_rloc_interface(&args_info);
957959
close(dsock_fd);
960+
unlink(LispClientIPCFile);
961+
958962
exit(0);
959963
}
960964

961965
if (args_info.list_given) {
962966
send_list_command(&args_info);
963967
close(dsock_fd);
968+
unlink(LispClientIPCFile);
969+
964970
exit(0);
965971
}
972+
unlink(LispClientIPCFile);
973+
966974
return 0;
967975
}

lispd_tuntap/lispd_ipc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
int sock_fd = 0;
2323

2424
const int LispIPCPathMax = 100;
25-
const char *LispServerIPCFile = "/data/data/com.le.lispmon/lispd_ipc_server";
26-
const char *LispClientIPCFile = "/data/data/com.le.lispmon/lispd_ipc_client";
25+
const char *LispServerIPCFile = "/data/data/com.le.lispmontun/lispd_ipc_server";
26+
const char *LispClientIPCFile = "/data/data/com.le.lispmontun/lispd_ipc_client";
2727
const int MaxIPCCommandLen = 1024;
2828

2929
struct sockaddr_un client_addr;

0 commit comments

Comments
 (0)