Add a variable offset to vpn_packet_t, drop sptps_packet_t.
The offset value indicates where the actual payload starts, so we can process both legacy and SPTPS UDP packets without having to do casting tricks and/or moving memory around.
This commit is contained in:
parent
107d9c7da5
commit
6b92ac505d
14 changed files with 234 additions and 212 deletions
|
|
@ -131,7 +131,7 @@ bool send_tcppacket(connection_t *c, const vpn_packet_t *packet) {
|
|||
if(!send_request(c, "%d %hd", PACKET, packet->len))
|
||||
return false;
|
||||
|
||||
return send_meta(c, (char *)packet->data, packet->len);
|
||||
return send_meta(c, (char *)DATA(packet), packet->len);
|
||||
}
|
||||
|
||||
bool tcppacket_h(connection_t *c, const char *request) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue