On Tue, 8 Mar 2005, and...@libero.it wrote: > Hi to all, > i can't understand why my code (based on openvpn's tun.c file) to > correctly read and write on win32 tap device doesn't work, > All i do is: > > 1 -- call get_tap_reg and get_panel_reg functions > > 2 -- call get_unspecified_device_guid function to obtain TAP id > > 3 -- call CreateFile on the device_path returned. It returns OK > > 4 -- call TAP_IOCTL_GET_VERSION, TAP_IOCTL_GET_MTU, > IoControls , to obtain TAP device driver and mtu info. All seems > ok. > > 5 -- call TAP_IOCTL_SET_MEDIA_STATUS IoControl to set the device > as "connected". ok > > 6 -- Then i call simple ReadFile to read data submitted on the > TAP interface. The problem is that some kind of packet > arrives, but they seems to be corrupted (es. an IPv6 header > format is totally wrong).
Does IPv4 work? Are you correctly extracting the IPv6 packet from the ethernet frame? Have you tried running OpenVPN in a debugger, and break on the TAP-Win32 calls, to get an idea of how OpenVPN is interacting with the driver? James