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