Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

How does /dev/net/tun works? Do I get back what I write?

$
0
0

Suppose that I want to send and receive data through a tun device.

I found the answer https://stackoverflow.com/a/35735842/6655884 where it opens /dev/net/tun as if it were a file and reads from it. However, what if I want to send a packet to it? If I simply write to it, then I'm gonna get the packet back when I read from it, or I migth get lucky and read after the packet was sent.

How it works? Does /dev/net/tun consumes what I write and not give it back when I read? Does it have knowledge of what is sent and received? I imagine it works like a file so whatever I write I get back when I read.


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>