Line 0
Link Here
|
|
|
1 |
--- hdhomerun_discover.c.orig 2019-09-30 16:45:23 UTC |
2 |
+++ hdhomerun_discover.c |
3 |
@@ -183,7 +183,8 @@ static bool hdhomerun_discover_send(struct hdhomerun_d |
4 |
unsigned int i; |
5 |
for (i = 1; i < ds->sock_count; i++) { |
6 |
struct hdhomerun_discover_sock_t *dss = &ds->socks[i]; |
7 |
- |
8 |
+ uint32_t send_ip = target_ip; |
9 |
+ |
10 |
if (target_ip != 0xFFFFFFFF) { |
11 |
if (dss->subnet_mask == 0) { |
12 |
continue; |
13 |
@@ -193,7 +194,18 @@ static bool hdhomerun_discover_send(struct hdhomerun_d |
14 |
} |
15 |
} |
16 |
|
17 |
- result |= hdhomerun_discover_send_internal(ds, dss, target_ip, device_type, device_id); |
18 |
+#if defined(IP_ONESBCAST) |
19 |
+ /* FreeBSD special handling - send subnet broadcast */ |
20 |
+ if (target_ip == 0xFFFFFFFF) { |
21 |
+ send_ip = dss->local_ip | ~dss->subnet_mask; |
22 |
+ |
23 |
+ if ((send_ip == 0x00000000) || (send_ip == 0xFFFFFFFF)) { |
24 |
+ continue; |
25 |
+ } |
26 |
+ } |
27 |
+#endif |
28 |
+ |
29 |
+ result |= hdhomerun_discover_send_internal(ds, dss, send_ip, device_type, device_id); |
30 |
} |
31 |
|
32 |
/* |