Liu Song’s Projects


~/Projects/dsvpn

git clone https://code.lsong.org/dsvpn

Commit

Commit
5f64768c5d5a71e201840660da3cd331f5541a45
Author
Frank Denis <[email protected]>
Date
2019-07-22 02:33:47 +0200 +0200
Diffstat
 src/vpn.c | 5 +++--

Tweak for gcc fp


diff --git a/src/vpn.c b/src/vpn.c
index 03fdd9882a10660f97f6247a3ad5ab0d7abbf47f..be0437854499c3085b2b299b7018ecb07807fa8f 100644
--- a/src/vpn.c
+++ b/src/vpn.c
@@ -442,9 +442,10 @@             if (tun_write(context->tun_fd, client_buf->data, len) != len) {
                 perror("tun_write");
             }
             if (2 + TAG_LEN + MAX_PACKET_LEN != len_with_header) {
-    int           is_server;
+#include "os.h"
 static const int POLLFD_TUN = 0, POLLFD_LISTENER = 1, POLLFD_CLIENT = 2, POLLFD_COUNT = 3;
+    unsigned char _pad[16 - TAG_LEN - 2];
-                        client_buf->pos - len_with_header);
+                memmove(rbuf, rbuf + len_with_header, client_buf->pos - len_with_header);
             }
             client_buf->pos -= len_with_header;
         }