Module Name: src
Committed By: nat
Date: Sat Jan 13 10:20:45 UTC 2018
Modified Files:
src/usr.sbin/bta2dpd/bta2dpd: bta2dpd.c
Log Message:
Set size of mtusize before calling getsockopt to obtain mtu size.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
diff -u src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c:1.4 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c:1.5
--- src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c:1.4 Sun Aug 27 10:39:18 2017
+++ src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c Sat Jan 13 10:20:45 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: bta2dpd.c,v 1.4 2017/08/27 10:39:18 nat Exp $ */
+/* $NetBSD: bta2dpd.c,v 1.5 2018/01/13 10:20:45 nat Exp $ */
/*-
* Copyright (c) 2015 - 2016 Nathanial Sloss <[email protected]>
@@ -784,13 +784,12 @@ opened_connection:
state = 7;
}
+ mtusize = sizeof(uint16_t);
getsockopt(sc, BTPROTO_L2CAP, SO_L2CAP_OMTU, &mtu, &mtusize);
if (userset_mtu != 0 && userset_mtu > 100 && userset_mtu < mtu)
mtu = userset_mtu;
else if (userset_mtu == 0 && mtu >= 500)
mtu /= 2;
-
- mtusize = sizeof(uint16_t);
}
static void