From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> This enables using l2test to connect or listen with L2CAP_ECRED_MODE. --- tools/l2test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/l2test.c b/tools/l2test.c index e787c2ce2..317515e68 100644 --- a/tools/l2test.c +++ b/tools/l2test.c @@ -149,6 +149,7 @@ static struct lookup_table l2cap_modes[] = { */ { "ertm", L2CAP_MODE_ERTM }, { "streaming", L2CAP_MODE_STREAMING }, + { "ecred", L2CAP_MODE_ECRED }, { 0 } }; @@ -282,7 +283,7 @@ static int getopts(int sk, struct l2cap_options *opts, bool connected) memset(opts, 0, sizeof(*opts)); - if (bdaddr_type == BDADDR_BREDR) { + if (bdaddr_type == BDADDR_BREDR || rfcmode) { optlen = sizeof(*opts); return getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, opts, &optlen); } @@ -298,7 +299,7 @@ static int getopts(int sk, struct l2cap_options *opts, bool connected) static int setopts(int sk, struct l2cap_options *opts) { - if (bdaddr_type == BDADDR_BREDR) + if (bdaddr_type == BDADDR_BREDR || rfcmode) return setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, opts, sizeof(*opts)); -- 2.21.0