Commit 546873a1 authored by Andreas Schmidt's avatar Andreas Schmidt

Fix maximum payload length.

parent 37f5e170
Pipeline #2064 failed with stages
in 21 seconds
......@@ -15,7 +15,7 @@
#define PRRT_MAX_RECEIVER_COUNT 255
#define MAX_PAYLOAD_LENGTH 65528 // maximum UDP packet length (2^16 - 8)
#define MAX_PAYLOAD_LENGTH 65507 // maximum UDP packet length (2^16 - 1 - 8 (UDP Header) - 20 (IP Header))
#define SEQNO_SPACE UINT16_MAX // 2**16 as seqno is uint16_t
......
......@@ -128,7 +128,7 @@ int main(int argc, char **argv) {
memcpy(&old, buffer, sizeof(struct timespec));
fprintf(stderr, "%u: %lli", i, timedelta(&old, &now));
fprintf(stderr, "%u: %lli\n", i, timedelta(&old, &now));
i++;
}
......
......@@ -116,7 +116,7 @@ int main(int argc, char **argv) {
XlapTimestampTableInstall(s, ts_redundancy_packet, tstable_redundancy);
uint32_t j = 0;
char buf[MAX_PAYLOAD_LENGTH];
char buf[MAX_PAYLOAD_LENGTH - PRRT_PACKET_GENERAL_HEADER_SIZE - PRRT_PACKET_DATA_HEADER_SIZE - 20];
memset(buf, 0x0, sizeof(buf));
assert(sizeof(buf) >= sizeof(struct timespec));
while (j < rounds) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment