summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-01-24 18:26:54 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-01-24 18:26:54 +0000
commita5fcb1982de75e464c1c41a660975c5d8ab4b47b (patch)
treec719b5fd728204290d40174962539373404d9557
parent3524d98e35685875e95daee7fa86a9c2178264a4 (diff)
Adopt data size from the MTU
-rw-r--r--test/l2test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/l2test.c b/test/l2test.c
index 06233d3f..859ce079 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -70,7 +70,7 @@ static int imtu = 672;
static int omtu = 0;
/* Default data size */
-static long data_size = 672;
+static long data_size = 0;
/* Default addr and psm */
static bdaddr_t bdaddr;
@@ -709,6 +709,13 @@ int main(int argc ,char *argv[])
exit(1);
}
+ if (!data_size) {
+ if (imtu > data_size)
+ data_size = imtu;
+ if (omtu > data_size)
+ data_size = omtu;
+ }
+
if (!(buf = malloc(data_size))) {
perror("Can't allocate data buffer");
exit(1);