diff options
author | Andre Guedes <andre.guedes@openbossa.org> | 2012-06-06 21:40:57 -0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-07 04:27:24 +0300 |
commit | ea2718060e53386a1b85abe298b20096f067488f (patch) | |
tree | e7e181f1c0cbe1a86bde913bba7655805f4a1681 | |
parent | 185c7ce8a4f22e9c9ecc9321a853ed8115f5aeaa (diff) | |
download | bluez-ea2718060e53386a1b85abe298b20096f067488f.tar.gz |
gattrib: Fix g_attrib_set_mtu
23 octets is the default (and minimum) ATT_MTU value. If someone tries
to set ATT_MTU less than 23 octets g_attrib_set_mtu should fail (return
FALSE). Additionally, there is no constraint regarding the maximum value
of ATT_MTU, so we should not check for it.
Also, we should not change the L2CAP ATT fixed channel MTU. bt_io_set
call will always fail since we are not supposed to change L2CAP MTU
after connection is established.
-rw-r--r-- | attrib/gattrib.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/attrib/gattrib.c b/attrib/gattrib.c index ee4de4bc7..fedc42e9d 100644 --- a/attrib/gattrib.c +++ b/attrib/gattrib.c @@ -627,14 +627,6 @@ uint8_t *g_attrib_get_buffer(GAttrib *attrib, int *len) gboolean g_attrib_set_mtu(GAttrib *attrib, int mtu) { if (mtu < ATT_DEFAULT_LE_MTU) - mtu = ATT_DEFAULT_LE_MTU; - - if (mtu > ATT_MAX_MTU) - mtu = ATT_MAX_MTU; - - if (!bt_io_set(attrib->io, BT_IO_L2CAP, NULL, - BT_IO_OPT_OMTU, mtu, - BT_IO_OPT_INVALID)) return FALSE; attrib->buf = g_realloc(attrib->buf, mtu); |