Require all incoming connections to be secure

This commit is contained in:
Johan Hedberg 2007-02-27 09:00:56 +00:00
parent 714bf0e9cd
commit 60159d1c8e

View File

@ -839,7 +839,7 @@ failed:
static int server_socket(uint8_t *channel)
{
int sock;
int sock, lm;
struct sockaddr_rc addr;
socklen_t sa_len;
@ -849,6 +849,13 @@ static int server_socket(uint8_t *channel)
return -1;
}
lm = RFCOMM_LM_SECURE;
if (setsockopt(sock, SOL_RFCOMM, RFCOMM_LM, &lm, sizeof(lm)) < 0) {
error("server setsockopt: %s", strerror(errno), errno);
close(sock);
return -1;
}
memset(&addr, 0, sizeof(addr));
addr.rc_family = AF_BLUETOOTH;
bacpy(&addr.rc_bdaddr, BDADDR_ANY);