i tunse资料库怎么cad如何增加选项条

networking - ioctl (TUNSETIFF) : device or resource busy - Stack Overflow
to customize your list.
Join the Stack Overflow Community
Stack Overflow is a community of 6.4 million programmers, just like you, helping each other.
J it only takes a minute:
I am unable to set TUN interface. Everywhere i searched and it says the device should be rooted.
I am setting up proxyserver on my ubuntu 14.04 system
static int get_interface(char *name) {
int interface = open("/dev/net/tun", O_RDWR | O_NONBLOCK);
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
if (ioctl(interface, TUNSETIFF, (void *)&ifr) & 0) {
perror("Cannot get TUN interface");
Know someone who can answer?
Share a link to this
via , , , or .
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Browse other questions tagged
Stack Overflow works best with JavaScript enabled

参考资料

 

随机推荐