l2cap_proxy icon indicating copy to clipboard operation
l2cap_proxy copied to clipboard

Don't set MTU on socket

Open fraca7 opened this issue 5 years ago • 2 comments

I have spent some time debugging this :) I was trying to use the proxy between a PS4 and a Dual Shock. Everything seemed to be fine, except that after the PS4 sent its "big" SDP packet (797 bytes), nothing happened and the outgoing connection to the PS4 on HID PSMs timed out.

Removing the MTU option fixed this. My guess (I'm no BT expert) is that the PS4 did not like a "fragmented" packet that wasn't actually fragmented (since the MTU was 1024, ace_send_data only had to call writev once). Now everything works fine. This is only a problem the first time the proxy is used with a given BTADDR of course, since subsequent connexions do not trigger the PS4 -> DS SDP stuff.

fraca7 avatar Sep 13 '20 11:09 fraca7

Thanks for sharing! Is the acl_send_data hack still necessary after removing the MTU option?

matlo avatar Sep 22 '20 09:09 matlo

Yes it is. On the other hand, removing the acl_send_data hack and setting the MTU doesn't work; write() still errors out with "invalid packet size" or something. So the only combination that works is acl_send_data + default MTU

fraca7 avatar Sep 22 '20 10:09 fraca7