Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ Akademy must have's:
icecream network destroy the fun and are not easy to find manually)

Random:
* Option -iiface to specify the interface[s] to listen on for the scheduler, or
to use for the daemon.
* Don't explicitly forbid tunnels because it could be useful for things like
vmware
* If someone calls a amd64 client on a host that runs a ia32 daemon and there are
no other amd64 daemons in the farm, he will get no answer, but a timeout from
scheduler (quite a corner case, but neat)
Expand Down
18 changes: 13 additions & 5 deletions services/comm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1473,8 +1473,8 @@ static int open_send_broadcast(int port, const char* buf, int size)
continue;
}

if ((addr->ifa_flags & IFF_POINTOPOINT) || !(addr->ifa_flags & IFF_BROADCAST)) {
log_info() << "ignoring tunnels " << addr->ifa_name << " for broadcast" << endl;
if (!(addr->ifa_flags & IFF_BROADCAST) && !(addr->ifa_flags & IFF_POINTOPOINT)) {
log_info() << "ignoring " << addr->ifa_name << " - has no broadcast address, nor is it point-to-point" << endl;
continue;
}
} else {
Expand All @@ -1484,15 +1484,23 @@ static int open_send_broadcast(int port, const char* buf, int size)
}
}

if (addr->ifa_broadaddr) {
sockaddr_in *broad_or_dst_addr = nullptr;

// both of these flags are never set at the same time
if (addr->ifa_flags & IFF_BROADCAST)
broad_or_dst_addr = (sockaddr_in *)addr->ifa_broadaddr;
if (addr->ifa_flags & IFF_POINTOPOINT)
broad_or_dst_addr = (sockaddr_in *)addr->ifa_dstaddr;

if (broad_or_dst_addr) {
log_info() << "broadcast "
<< addr->ifa_name << " "
<< inet_ntoa(((sockaddr_in *)addr->ifa_broadaddr)->sin_addr)
<< inet_ntoa(broad_or_dst_addr->sin_addr)
<< endl;

remote_addr.sin_family = AF_INET;
remote_addr.sin_port = htons(port);
remote_addr.sin_addr = ((sockaddr_in *)addr->ifa_broadaddr)->sin_addr;
remote_addr.sin_addr = broad_or_dst_addr->sin_addr;

if (sendto(ask_fd, buf, size, 0, (struct sockaddr *)&remote_addr,
sizeof(remote_addr)) != size) {
Expand Down