Commit 9819c84
committed
fix: reject non-working socket configuration
For IPv6, a shared listener/responder socket is not really possible
when sending to link-local IPv6 multicast addresses (ff02::/16):
The kernel needs to know which interface to use for routing.
On IPv4, this is historically a bit different, the kernel just uses
what it deems the primary/best route interface based on the routing
table. But for IPv6, a message is rejected by Linux with OSError no 99
"Cannot assign requested address" and OSError no 65 "No route to host"
on macOS.
This change rejects InterfaceChoice.Default IPv6 only or IPv6/IPv4
dual-stack configurations.
As a further cleanup, move the socket options for sending multicast
packets out of the common socket creation code. For listen only sockets
those settings are not needed.
Since we allow shared listener/responder sockets, with IPv4 only
sockets now, the macOS error address in #392 is not a problem anymore.
Actually, we would like to get an exception in case we get into
this combination, so remove the explicit exception handling.1 parent 754b787 commit 9819c84
File tree
3 files changed
+34
-35
lines changed- src/zeroconf/_utils
- tests
- utils
3 files changed
+34
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 150 | + | |
| 151 | + | |
154 | 152 | | |
155 | 153 | | |
156 | 154 | | |
| |||
198 | 196 | | |
199 | 197 | | |
200 | 198 | | |
201 | | - | |
| 199 | + | |
202 | 200 | | |
203 | | - | |
204 | 201 | | |
205 | 202 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 203 | + | |
| 204 | + | |
210 | 205 | | |
211 | 206 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
220 | 212 | | |
221 | 213 | | |
222 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
223 | 226 | | |
224 | 227 | | |
225 | 228 | | |
| |||
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| |||
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
| 427 | + | |
| 428 | + | |
426 | 429 | | |
427 | 430 | | |
428 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 171 | + | |
176 | 172 | | |
177 | | - | |
| 173 | + | |
178 | 174 | | |
179 | | - | |
180 | | - | |
181 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
182 | 178 | | |
183 | 179 | | |
184 | 180 | | |
| |||
0 commit comments