Commit 91a5489
committed
fix(net): fallback multicast join without adapters
ifaddr may return no adapters in sandboxed environments, which prevents mDNS multicast membership and leads to empty scan results. Detect a default IPv4 via a dummy UDP connect and use it for IP_MULTICAST_IF/ADD_MEMBERSHIP while keeping the socket bind on an empty string to avoid conflicts. Reuse the same probe fallback in get_private_addresses so callers still obtain a usable IPv4 when adapter enumeration is empty.1 parent 1aec1c0 commit 91a5489
1 file changed
+31
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
50 | 70 | | |
51 | 71 | | |
52 | 72 | | |
| |||
74 | 94 | | |
75 | 95 | | |
76 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
77 | 108 | | |
78 | 109 | | |
79 | 110 | | |
| |||
0 commit comments