Lines Matching refs:tunfd
129 static int tunfd = -1; variable
160 tunfd = open("/dev/net/tun", O_RDWR | O_NONBLOCK); in initialize_tun()
161 if (tunfd == -1) { in initialize_tun()
173 if (dup2(tunfd, kTunFd) < 0) in initialize_tun()
175 close(tunfd); in initialize_tun()
176 tunfd = kTunFd; in initialize_tun()
182 if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) { in initialize_tun()
185 if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) in initialize_tun()
190 if (ioctl(tunfd, TUNGETIFF, (void*)&ifr) < 0) in initialize_tun()
309 if (tunfd < 0) in read_tun()
312 int rv = read(tunfd, data, size); in read_tun()
344 if (tunfd < 0) in syz_emit_ethernet()
382 return writev(tunfd, vecs, nfrags); in syz_emit_ethernet()
426 if (tunfd < 0) in syz_extract_tcp_res()