|
|
@ -591,7 +591,7 @@ int main(int argc, char *argv[])
|
|
|
|
int setup_if_addr(char *ip_addr)
|
|
|
|
int setup_if_addr(char *ip_addr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char *dev = (char*) "tun_srsenb";
|
|
|
|
char *dev = (char*) "tun_srsenb";
|
|
|
|
int sock = 0;
|
|
|
|
int sock;
|
|
|
|
|
|
|
|
|
|
|
|
// Construct the TUN device
|
|
|
|
// Construct the TUN device
|
|
|
|
int tun_fd = open("/dev/net/tun", O_RDWR);
|
|
|
|
int tun_fd = open("/dev/net/tun", O_RDWR);
|
|
|
@ -642,10 +642,12 @@ int setup_if_addr(char *ip_addr)
|
|
|
|
perror("ioctl");
|
|
|
|
perror("ioctl");
|
|
|
|
goto clean_exit;
|
|
|
|
goto clean_exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
shutdown(sock, SHUT_RDWR);
|
|
|
|
|
|
|
|
|
|
|
|
return(tun_fd);
|
|
|
|
return(tun_fd);
|
|
|
|
|
|
|
|
|
|
|
|
clean_exit:
|
|
|
|
clean_exit:
|
|
|
|
|
|
|
|
shutdown(sock, SHUT_RDWR);
|
|
|
|
close(tun_fd);
|
|
|
|
close(tun_fd);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|