I'm working with this example just now. I realize that when you make this call:
IntPtr ptun = Marshal.AllocHGlobal(12);
Marshal.WriteInt32(ptun, 0, 0x0100030a); // 10.0.0.1, Interface address
Marshal.WriteInt32(ptun, 4, 0x0000030a); // 10.0.0.0, Network
Marshal.WriteInt32(ptun, 8, unchecked((int)0x00ffffff)); // 255.255.255.0, Netmask
// Config TUN
DeviceIoControl (ptr,
TAP_CONTROL_CODE (10, METHOD_BUFFERED)
ptun,
12,
ptun,
12,
out len,
IntPtr.Zero);
it's when the interface is placed in TUN mode. What I did was just to ignore this (I did't make this call to DeviceIoControl), and then all packets where received by the File Stream.