summaryrefslogtreecommitdiffstats
path: root/test/l2test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/l2test.c')
-rw-r--r--test/l2test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/l2test.c b/test/l2test.c
index e9a7d50d..06233d3f 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -286,7 +286,7 @@ static void do_listen(void (*handler)(int sk))
if (secure)
opt |= L2CAP_LM_SECURE;
- if (setsockopt(s, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) {
+ if (opt && setsockopt(s, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) {
syslog(LOG_ERR, "Can't set L2CAP link mode: %s (%d)", strerror(errno), errno);
exit(1);
}