-   Linux - Networking (
-   -   tun tap query (

karan84 01-21-2007 12:27 PM

tun tap query
i have one doubt
i configured the tun0 interface after the open systemcall

the interface is up and running
next i configured it using the following:

"ifconfig %s pointopoint mtu 1500"

next i created a simple udp server which sends a message like"hello" to the tun0 interface

In my tunnel code,if i want to read from the /dev/net/tun interface, if i use the following code

len=read(tuntapfd,temp_buffer,sizeof(temp_buffer));//hangs here
printf("\n recieved.........\n");
printf("failed :( :( :( ........");

i know that i shud be using select for reading and shud be non blocking,but i just wantd to test it with a simple read statement

the problem is that the program hangs???????
the data it seems has not been transferred to the /dev/net/tun character device file

please help me out on this
what my doubt exactly is that if i send data say"hello" on the tun0 interface ,will my code be able to use it or access it using the /dev/net/tun character file because this is what i have been trying with no success

how should i proceed with this?


melvinebenezer@gmail 03-26-2007 11:29 AM

i hav a similar problem ..... did you manage to solve it

All times are GMT -5. The time now is 07:34 PM.