On Tue, 28. Jan 16:59, Luiz Augusto von Dentz wrote: > > @@ -622,7 +623,7 @@ static gboolean set_l2opts(int sock, uint16_t imtu, uint16_t omtu, > > return FALSE; > > } > > > > - if (imtu) > > + if (imtu || auto_mtu) > > l2o.imtu = imtu; > > We might need to do some more special handling for auto_mtu, so in > case it fail we retry with the default values instead. Yep, a good point. And I see now it _might_ fail here for the kernels without the corresponding patch. > > static gboolean l2cap_set(int sock, uint8_t src_type, int sec_level, > > - uint16_t imtu, uint16_t omtu, uint8_t mode, > > - int central, int flushable, uint32_t priority, > > - GError **err) > > + uint16_t imtu, uint16_t omtu, uint8_t auto_mtu, > > + uint8_t mode, int central, int flushable, > > + uint32_t priority, GError **err) > > { > > - if (imtu || omtu || mode) { > > + if (imtu || omtu || auto_mtu || mode) { > > gboolean ret = FALSE; > > > > if (src_type == BDADDR_BREDR) > > - ret = set_l2opts(sock, imtu, omtu, mode, err); > > + ret = set_l2opts(sock, imtu, omtu, auto_mtu, mode, err); > > Perhaps here we do: > > if (ret && auto_mtu) > ret = set_l2opts(sock, imtu, omtu, false, mode, err); > > Thoughts? Agreed, trying the original default behavior will work with existing kernels. I'll respin the series. > > > else { > > - if (imtu) > > + if (imtu || auto_mtu) > > ret = set_le_imtu(sock, imtu, err); Huh, the BT_RCVMTU case may also fail for L2CAP_MODE_EXT_FLOWCTL (that's not something I'm prepared to reproduce though). l2cap_chan_reconfigure() will reject a zero imtu. Worth adding some another kernel patch or ECRED should not actually support MTU auto-tuning?