}
size_t len = strlen(request);
- from->in_forward += len;
- to->out_forward += len;
+ from->in_forward += len + SPTPS_OVERHEAD;
+ to->out_forward += len + SPTPS_OVERHEAD;
send_request(mesh, to->nexthop->connection, NULL, "%s", request);
}
/* TODO: find a good way to avoid the use of strlen() */
size_t len = strlen(request);
- from->in_forward += len;
- to->out_forward += len;
+ from->in_forward += len + SPTPS_OVERHEAD;
+ to->out_forward += len + SPTPS_OVERHEAD;
/* Append the known UDP address of the from node, if we have a confirmed one */
if(!*address && from->status.udp_confirmed && from->address.sa.sa_family != AF_UNSPEC) {
// Channel traffic accounting
if(source == mesh->self) {
- dest->out_data += len;
+ dest->out_data += len + SPTPS_OVERHEAD;
}
if(dest == mesh->self) {
- source->in_data += len;
+ source->in_data += len + SPTPS_OVERHEAD;
const void *payload = packet->data + sizeof(*hdr);
char hex[len * 2 + 1];