Repository navigation
Commit de1cd38
committed
dns: validate both addresses before applying them in setLocalAddress
SetLocalAddress() applied the first address to the c-ares channel with
ares_set_local_ip4()/ares_set_local_ip6() before parsing and validating
the second one. A call that then threw ERR_INVALID_ARG_VALUE, because
both addresses were of the same family or the second address was
invalid, left the first address in effect, so later queries were sent
from an address the caller had been told was rejected.
Parse and validate both arguments first and only then apply them. With
a single argument the other family is still reset to "any", as before.
Fixes: #67049
Signed-off-by: Martin Mirchev <mmirchev@comp.nus.edu.sg>1 parent 98dbf60 commit de1cd38
2 files changed
Lines changed: 56 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2332 | 2332 | | |
2333 | 2333 | | |
2334 | 2334 | | |
2335 | | - | |
2336 | 2335 | | |
2337 | 2336 | | |
2338 | | - | |
2339 | 2337 | | |
2340 | 2338 | | |
2341 | 2339 | | |
2342 | 2340 | | |
2343 | 2341 | | |
2344 | 2342 | | |
| 2343 | + | |
| 2344 | + | |
2345 | 2345 | | |
2346 | 2346 | | |
2347 | 2347 | | |
| |||
2350 | 2350 | | |
2351 | 2351 | | |
2352 | 2352 | | |
2353 | | - | |
2354 | | - | |
2355 | | - | |
2356 | 2353 | | |
2357 | 2354 | | |
2358 | 2355 | | |
2359 | 2356 | | |
2360 | 2357 | | |
2361 | | - | |
2362 | | - | |
2363 | 2358 | | |
2364 | 2359 | | |
2365 | 2360 | | |
2366 | 2361 | | |
2367 | 2362 | | |
2368 | 2363 | | |
2369 | 2364 | | |
2370 | | - | |
2371 | | - | |
2372 | | - | |
2373 | | - | |
2374 | | - | |
2375 | | - | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
2376 | 2374 | | |
2377 | 2375 | | |
2378 | 2376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments