mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-30 07:34:27 +08:00
hcidump: Use broadcast address for discover socket
This commit is contained in:
parent
ebfc59f868
commit
458951454a
@ -699,15 +699,10 @@ static int create_datagram(unsigned short port)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (setsockopt(sk, SOL_SOCKET, SO_BROADCAST, &opt, sizeof(opt)) < 0) {
|
||||
close(sk);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(port);
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
addr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
|
||||
|
||||
if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
|
||||
close(sk);
|
||||
|
Loading…
Reference in New Issue
Block a user