]> git.meshlink.io Git - meshlink/blobdiff - src/route.c
Move definition of sockaddr_t to its own header, remove length_t.
[meshlink] / src / route.c
index 8a952a7817404ab402baedb04ff64cd3779c8ecf..450baf9049159e944174f86b1c0623d6fd0c19ea 100644 (file)
@@ -43,7 +43,7 @@ static bool ratelimit(int frequency) {
        return false;
 }
 
-static bool checklength(node_t *source, vpn_packet_t *packet, length_t length) {
+static bool checklength(node_t *source, vpn_packet_t *packet, uint16_t length) {
        if(packet->len < length) {
                logger(DEBUG_TRAFFIC, LOG_WARNING, "Got too short packet from %s (%s)", source->name, source->hostname);
                return false;
@@ -73,8 +73,8 @@ void route(node_t *source,vpn_packet_t *packet) {
 
     if (owner == myself ) {
     //TODO: implement sending received data from meshlink library to the application
-    logger(DEBUG_TRAFFIC, LOG_WARNING, "I received a packet for me with payload: %s \n", packet->data + 46);
-    (recv_callback)(packet->data + 46);
+    logger(DEBUG_TRAFFIC, LOG_WARNING, "I received a packet for me with payload: %s \n", packet->data + sizeof *hdr);
+    (recv_callback)(packet->data + sizeof *hdr);
     return;
     }