]> git.meshlink.io Git - meshlink/blobdiff - src/protocol.c
Previous fix fixed. Meta protocol should be really flawless from now on!
[meshlink] / src / protocol.c
index 0a27692e89282f26dd9e95b2a6dc85b3e35d42cc..c6b6fec6660e0ed84c756fa77a21112221acc0e5 100644 (file)
@@ -616,7 +616,9 @@ cp
     syslog(LOG_DEBUG, "Forwarding request for public key to " IP_ADDR_S,
           IP_ADDR_V(fw->nexthop->vpn_ip));
   
-  if(write(fw->nexthop->meta_socket, cl->buffer, strlen(cl->buffer)) < 0)
+  cl->buffer[cl->reqlen-1] = '\n';
+  
+  if(write(fw->nexthop->meta_socket, cl->buffer, cl->reqlen) < 0)
     {
       syslog(LOG_ERR, "send failed: %s:%d: %m", __FILE__, __LINE__);
       return -1;
@@ -711,7 +713,9 @@ cp
     syslog(LOG_DEBUG, "Forwarding public key to " IP_ADDR_S,
           IP_ADDR_V(fw->nexthop->vpn_ip));
 
-  if((write(fw->nexthop->meta_socket, cl->buffer, strlen(cl->buffer))) < 0)
+  cl->buffer[cl->reqlen-1] = '\n';
+
+  if((write(fw->nexthop->meta_socket, cl->buffer, cl->reqlen)) < 0)
     {
       syslog(LOG_ERR, "send failed: %s:%d: %m", __FILE__, __LINE__);
       return -1;