Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't set MTU on socket #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions l2cap_con.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,34 +154,14 @@ int acl_send_data (const char *bdaddr_dst, unsigned short cid, const unsigned ch
return ret;
}

#define L2CAP_MTU 1024

static void l2cap_setsockopt(int fd)
{
struct l2cap_options l2o;
socklen_t len = sizeof(l2o);

int opt = L2CAP_LM_MASTER;
if (setsockopt(fd, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0)
{
perror("setsockopt L2CAP_LM");
}

memset(&l2o, 0, sizeof(l2o));
if(getsockopt(fd, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &len) < 0)
{
perror("getsockopt L2CAP_OPTIONS");
}
else
{
l2o.omtu = L2CAP_MTU;
l2o.imtu = L2CAP_MTU;
if(setsockopt(fd, SOL_L2CAP, L2CAP_OPTIONS, &l2o, sizeof(l2o)) < 0)
{
perror("setsockopt L2CAP_OPTIONS");
}
}

/*if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
{
perror("fcntl O_NONBLOCK");
Expand Down