mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
wait until socket can be bind
This commit is contained in:
parent
6eee1214a2
commit
aa6f72e7ed
2 changed files with 3 additions and 2 deletions
|
@ -32,10 +32,10 @@ int setup_broadcast_socket(const char *_broadcast_ip, unsigned short _broadcast_
|
|||
addr->sin_addr.s_addr = inet_addr(_broadcast_ip);
|
||||
addr->sin_port = htons(_broadcast_port);
|
||||
|
||||
if (bind(sock, (struct sockaddr *) addr, sizeof(*addr)) <
|
||||
while (bind(sock, (struct sockaddr *) addr, sizeof(*addr)) <
|
||||
0) {
|
||||
fprintf(stderr, "Binding socket failed!\n");
|
||||
return -1;
|
||||
sleep(1);
|
||||
}
|
||||
return sock;
|
||||
}
|
|
@ -607,6 +607,7 @@ void update_clients(struct uloop_timeout *t) {
|
|||
}
|
||||
|
||||
void update_hostapd_sockets(struct uloop_timeout *t) {
|
||||
printf("Updating hostapd sockets!\n");
|
||||
subscribe_to_hostapd_interfaces(hostapd_dir_glob);
|
||||
uloop_timeout_set(&hostapd_timer, timeout_config.update_hostapd * 1000);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue