On 11/06/13 18:00, wen lui wrote:
> Hi, all:
> 
>     I encountered a strange problem, my problem is detailed in this link
> 
> http://stackoverflow.com/questions/16915322/delivering-a-packet-through-tun-file-descriptor-leads-to-different-results
> 
> can anyone help me with this problem?
> 
> thanks!

The OpenVPN project didn't write the tun/tap driver for Linux (or BSD
and Solaris).  So I would recommend you to check this out with the Linux
kernel networking team, as they most likely have a broader understanding
on how this driver works.

You do use openvpn to create the tun device, but you could just as well
used tunctl for the same operation.

Having all that said ... your program partly works for me - but not
reliably.  I did one code change, I had to use 10.99.0.1/24 as my IP
address to avoid address conflicts.  So I used this line:

    packet = create_icmp_pkt(100, "10.99.0.2", "10.99.0.1", 500, 5);

And I had to run your program as root (to gain access to the tun
device).  In addition, I ensured that my firewall was not adding any
obstacles by adding this iptables rule:

    iptables -I INPUT -i tun2 -j ACCEPT

When running your program via strace, it works reliably though.  Which
is surprising.

So I still recommend you to discuss this with the Linux Kernel
networking group.

<http://kernelnewbies.org/ML#head-007c59cc4d4ffcd7aacd7fabb6234d9b5a52c61a>



-- 
kind regards,

David Sommerseth

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to