taptun
taptun copied to clipboard
Truncated packets/IFF_NO_PI
The documentation seems to disagree with the code with regards to the protocol information header on packets received from the kernel. ReadFrame suggests the the protocol information header is present "The buffer supplied must be large enough to hold the whole frame including a 4 byte header returned by the kernel.", though the interfaces are created with IFF_NO_PI, so the header is not present. Similarly the documentation claims to detect and report truncated packets via returning ErrTruncated but doesn't (and afaik isn't possible without looking at the protocol information header).
Honestly I tried it both ways, this was the only one that didn't corrupt packets. I probably need to reduce the advertised mtu on the interface, that will probably fix the problem.
On Mon, Nov 10, 2014 at 10:12 PM, ebfe [email protected] wrote:
The documentation seems to disagree with the code with regards to the protocol information header on packets received from the kernel. ReadFrame suggests the the protocol information header is present "The buffer supplied must be large enough to hold the whole frame including a 4 byte header returned by the kernel.", though the interfaces are created with IFF_NO_PI, so the header is not present. Similarly the documentation claims to detect and report truncated packets via returning ErrTruncated but doesn't (and afaik isn't possible without looking at the protocol information header).
— Reply to this email directly or view it on GitHub https://github.com/pkg/taptun/issues/1.