Closed sgstair closed 5 years ago
Quite a bit of refactoring, to move two fairly similar code branches into one common TapSharedSendPacket(), cleaning up the nested levels of "if (thing != NULL) { ... if (nextthing != NULL)..." while at it.
And, adding padding on the path "minimum sized packet comes in from OpenVPN or locally generated (IndicateReceivePacket()) and needs to be sent to NDIS as a properly-minimum-sized Ethernet frame", but that part is fairly harmless after the rest got cleaned up :-)
ACK.
HLK tests require that packets are padded to the minimum ethernet length. While that isn't strictly necessary for something like tap-windows6, it has been implemented here to make the test happy. The change adds padding to the packet to be returned to the OS if necessary to meet this requirement, combining this padding with prefixing if possible (on the TUN path)