Make failed TUN socket operation non-fatal

It might be desirable to run the UE without superuser rights. More
concretely, it might run without NET_ADMIN. In this case, various
corresponding operations on the TUN socket fd might fail. In this
commit,

- improve error reports to make them more clear
- do not automatically exit(1), but return from the function to ensure
  continuity of the softmodem
This commit is contained in:
Robert Schmidt
2024-06-03 14:00:49 +02:00
parent 8dc29be02f
commit 9b3ab10c20
2 changed files with 6 additions and 7 deletions
@@ -144,7 +144,7 @@ int netlink_init_tun(char *ifprefix, int num_if, int id) {//for UE, id = 1, 2, .
if (nas_sock_fd[i] == -1) {
LOG_E(PDCP, "TUN: Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
exit(1);
return 0;
}
LOG_I(PDCP, "TUN: Opened socket %s with fd nas_sock_fd[%d]=%d\n",