linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix MTU value used on MTU exchange response
@ 2011-02-24 21:37 Bruna Moreira
  2011-02-24 21:43 ` Brian Gix
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Bruna Moreira @ 2011-02-24 21:37 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Bruna Moreira

The new MTU value only should be applied in server side after sending
the ATT_MTU_RESP so encode the response using the old MTU value.
---
 src/attrib-server.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index 62c10f4..9de4c81 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -773,9 +773,11 @@ static uint16_t write_value(struct gatt_channel *channel, uint16_t handle,
 static uint16_t mtu_exchange(struct gatt_channel *channel, uint16_t mtu,
 		uint8_t *pdu, int len)
 {
+	guint old_mtu = channel->mtu;
+
 	channel->mtu = MIN(mtu, channel->mtu);
 
-	return enc_mtu_resp(channel->mtu, pdu, len);
+	return enc_mtu_resp(old_mtu, pdu, len);
 }
 
 static void channel_disconnect(void *user_data)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-03-10  9:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-24 21:37 [PATCH] Fix MTU value used on MTU exchange response Bruna Moreira
2011-02-24 21:43 ` Brian Gix
2011-02-24 21:58   ` Bruna Moreira
2011-02-24 22:06     ` Brian Gix
2011-03-02 16:34 ` [PATCHv2 1/2] Use CID to infer transport type Bruna Moreira
2011-03-04 19:32   ` Bruna Moreira
2011-03-02 16:34 ` [PATCHv2 2/2] Fix MTU value used on MTU exchange response Bruna Moreira
2011-03-04 20:17   ` [PATCHv3 1/2] Use CID to infer transport type Bruna Moreira
2011-03-10  9:09     ` Johan Hedberg
2011-03-04 20:17   ` [PATCHv3 2/2] Fix MTU value used on MTU exchange response Bruna Moreira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).