Commit Graph
52 Commits
Author SHA1 Message Date
Alex PaguisandCuong Manh Le 46a1039f21 guard against nil interface 2025-02-27 18:53:10 +07:00
Alex PaguisandCuong Manh Le e68bfa795a add a small delay service start self check 2025-02-25 20:07:57 +07:00
AlexandCuong Manh Le 62fe14f76b prevent running on custom ports for clients 2025-02-24 18:36:18 +07:00
Alex PaguisandCuong Manh Le a0c5062e3a Resolve "OS upstream failure / wrong default route" 2025-02-24 18:36:08 +07:00
AlexandCuong Manh Le 49eb152d02 transport should try ipv4 then ipv6 explicitly
client list panic guards and debug logging
2025-02-21 20:44:34 +07:00
AlexandCuong Manh Le 5b1faf1ce3 dont allow positional args in start commands 2025-02-21 20:44:34 +07:00
AlexandCuong Manh Le 332f8ccc37 debugging save/restore staticinterface settings
postRun should not restore static settings

put back validInterface check

better debug logs for os resolver init, use mutex to prevent duplicate initializations

use WMI instead of registry keys for static DNS data on Windows

use WMI instead of registry keys for static DNS data on Windows

use winipcfg DNS method

use WMI with registry fallback

go back to registry method

restore saved static configs on stop and uninstall

restore ipv6 DHCP if no saved static ipv6 addresses

do not save loopback IPs for static configs

handle watchdog interface changed for new interfaces

dont overwrite static file on start when staticdns is set to loopback

dont overwrite static file on start when staticdns is set to loopback

dont overwrite static file on start when staticdns is set to loopback

no need to resetDNS on start, uninstall already takes care of this
2025-02-21 20:44:34 +07:00
AlexandCuong Manh Le eff5ff580b use saved static nameservers stored for the default router interface when doing nameserver discovery
fix bad logger usages

patch darwin interface name

patch darwin interface name, debugging

make resetDNS check for static config on startup, optionally restoring static confiration as needed

fix netmon logging
2025-02-21 20:33:04 +07:00
Alex PaguisandCuong Manh Le 414d4e356d dont repeat ipv6availablity for each interface, increase self check timeout but reduce max attempts 2025-02-18 20:31:56 +07:00
AlexandCuong Manh Le 3480043e40 handle default route changes
remove old os resolver IPs on interface down

better debugging for os resolver
2025-02-18 20:30:54 +07:00
AlexandCuong Manh Le 0123ca44fb ignore ipv6 addresses from defaultRouteIP, guard against using ipv6 address as v4 default 2025-02-18 20:25:35 +07:00
AlexandCuong Manh Le 7929aafe2a OS resolver retry should respect the leak_on_upstream_failure config option 2025-02-18 20:25:26 +07:00
AlexandCuong Manh Le c329402f5d remove DNS lookups from IPv6 check, close the connection
log ipv6 availability logic

more debugging for ipv6 availability checks

more debugging for ipv6 availability checks
2025-02-18 20:24:25 +07:00
AlexandCuong Manh Le 23e6ad6e1f use first public os reolver response when no LAN servers exist
os resolver debugging improvement

use first public non success answer when no LAN nameservers exist

use first public non success answer when no LAN nameservers exist

fix the os resolver test
2025-02-18 20:23:36 +07:00
AlexandCuong Manh Le e6de78c1fa fix leak_on_upstream_failure config param 2025-02-18 20:22:33 +07:00
AlexandCuong Manh Le a670708f93 do not exclude public nameservers from OS resolver queries
remove controld nameservers from public list if thsi is a LAN query

fixed comment

simpler index check

debugging and error for actually no nameservers
2025-02-18 20:21:36 +07:00
AlexandCuong Manh Le 81e0bad739 increase failure count for all queries with no answer 2025-02-11 19:29:48 +07:00
AlexandCuong Manh Le 7d07d738dc fix failure count on OS retry 2025-02-11 19:28:55 +07:00
AlexandCuong Manh Le 0fae584e65 OS resolver retry catch all 2025-02-11 19:27:50 +07:00
AlexandCuong Manh Le 9e83085f2a handle old state missing interface crash 2025-02-11 19:27:46 +07:00
AlexandCuong Manh Le 41a00c68ac fix down state handling 2025-02-11 19:27:41 +07:00
AlexandCuong Manh Le e3b99bf339 mark upstream as down after 10s of no successful queries 2025-02-11 19:27:36 +07:00
AlexandCuong Manh Le 60e65a37a6 do the reset after recovery finished 2025-02-10 18:56:09 +07:00
AlexandCuong Manh Le d37d0e942c fix countHealthy locking 2025-02-10 18:55:48 +07:00
AlexandCuong Manh Le 98042d8dbd remove leaking logic in favor of recovery logic. 2025-02-10 18:55:36 +07:00
AlexandCuong Manh Le 398f71fd00 fix leakingQueryReset usages 2025-02-10 18:44:52 +07:00
AlexandCuong Manh Le e1301ade96 remove context timeout 2025-02-10 18:44:46 +07:00
AlexandCuong Manh Le 7a23f82192 set leakingQueryReset to prevent watchdogs from resetting dns 2025-02-10 18:44:40 +07:00
AlexandCuong Manh Le 0c74838740 init os resolver after upstream recovers 2025-02-10 18:44:23 +07:00
AlexandCuong Manh Le 4b05b6da7b fix missing unlock 2025-02-10 18:43:03 +07:00
AlexandCuong Manh Le 375844ff1a remove handler log line 2025-02-10 18:42:59 +07:00
AlexandCuong Manh Le 1d207379cb wait for healthy upstream before accepting queries on network change 2025-02-10 18:42:53 +07:00
AlexandCuong Manh Le fb49cb71e3 debounce upstream failure checking and failure counts 2025-02-10 18:41:48 +07:00
AlexandCuong Manh Le 9618efbcde improve network change ip filtering logic 2025-02-10 18:41:43 +07:00
AlexandCuong Manh Le bb2210b06a ip detection debugging 2025-02-10 18:41:39 +07:00
AlexandCuong Manh Le 917052723d don't overwrite OS resolver nameservers if there arent any 2025-02-10 18:41:34 +07:00
AlexandCuong Manh Le fef85cadeb filter non usabel IPs from state changes 2025-02-10 18:41:30 +07:00
AlexandCuong Manh Le 4a05fb6b28 use the changed iface if no default route is set yet 2025-02-10 18:41:25 +07:00
AlexandCuong Manh Le 6644ce53f2 fix interface IP CIDR parsing 2025-02-10 18:41:20 +07:00
AlexandCuong Manh Le 72f0b89fdc remove redundant return 2025-02-10 18:41:15 +07:00
AlexandCuong Manh Le 41a97a6609 clean up network change state logic 2025-02-10 18:41:05 +07:00
AlexandCuong Manh Le 38064d6ad5 parse InterfaceIPs for network delta, not just ifs block 2025-02-10 18:40:52 +07:00
AlexandCuong Manh Le cf6d16b439 set new dialer on every request
debugging

debugging

debugging

debugging

use default route interface IP for OS resolver queries

remove retries

fix resolv.conf clobbering on MacOS, set custom local addr for os resolver queries

remove the client info discovery logic on network change, this was overkill just for the IP, and was causing service failure after switching networks many times rapidly

handle ipv6 local addresses

guard ciTable from nil pointer

debugging failure count
2025-02-06 15:40:41 +07:00
AlexandCuong Manh Le 2d3779ec27 fix MacOS nameserver detection, fix not installed errors for commands
copy

fix get valid ifaces in nameservers_bsd

nameservers on MacOS can be found in resolv.conf reliably

nameservers on MacOS can be found in resolv.conf reliably

exclude local IPs from MacOS resolve conf check

use scutil for MacOS, simplify reinit logic to prevent duplicate calls

add more dns server fetching options

never skip OS resolver in IsDown check

split dsb and darwin nameserver methods, add delay for setting DNS on interface on network change.

increase delay to 5s but only on MacOS
2025-02-05 13:18:06 +07:00
AlexandCuong Manh Le 168eaf538b increase OSresolver timeout, fix debug log statements
flush dns cache, manually hit captive portal on MacOS

fix real ip in debug log

treat all upstreams as down upon network change

delay upstream checks when leaking queries on network changes
2025-02-04 18:03:41 +07:00
AlexandCuong Manh Le 028475a193 fix os.Resolve method to prefer LAN answers
fix os.Resolve method to prefer LAN answers

early return for stop cmd when not installed or stopped

increase service restart delay to 5s
2025-02-02 11:21:39 +07:00
AlexandCuong Manh Le f7a6dbe39b fix upgrade flow
set service on new run, fix duplicate args

set service on new run, fix duplicate args

revert startCmd in upgrade flow due to pin compat issues

make restart reset DNS like upgrade, add debugging to uninstall method

debugging

debugging

debugging

debugging

debugging WMI

remove stackexchange lib, use ms wmi pkg

debugging

debugging

set correct class

fix os reolver init issues

fix netadapter class

use os resolver instead of fetching default nameservers while already running

remove debug lines

fix lookup IP

fix lookup IP

fix lookup IP

fix lookup IP

fix dns namserver retries when not needed
2025-01-31 20:04:03 +07:00
AlexandCuong Manh Le e573a490c9 ignore non physical ifaces in validInterfaces method on Windows
debugging

skip type 24 in nameserver detection

skip type 24 in nameserver detection

remove interface type check from valid interfaces for now

skip non hardware interfaces in DNS nameserver lookup

ignore win api log output

set retries to 5 and 1s backoff

reset DNS when upgrading to make sure we get the proper OS nameservers on start

init running iface for upgrade

update windows service options for auto restarts on failure

make upgrade use the actual stop and start commands

fix the windows service retry logic

fix the windows service retry logic

task debugging

more task debugging

windows service name fix

windows service name fix

fix start command args

fix restart delay

dont recover from non crash failures

fix upgrade flow
2025-01-30 17:06:43 +07:00
AlexandCuong Manh Le ce3281e70d much more debugging, improved nameserver detection, no more testing nameservers
fix logging

fix logging

try to enable nameserver logs

try to enable nameserver logs

handle flags in interface state changes

debugging

debugging

debugging

fix state detection, AD status fix

fix debugging line

more dc info

always log state changes

remove unused method

windows AD IP discovery

windows AD IP discovery

windows AD IP discovery
2025-01-29 12:28:49 +07:00
AlexandCuong Manh Le 2687a4a018 remove leaking timeout, fix blocking upstreams checks, leaking is per listener, OS resolvers are tested in parallel, reset is only done is os is down
fix test

use upstreamIS var

init map, fix watcher flag

attempt to detect network changes

attempt to detect network changes

cancel and rerun reinitializeOSResolver

cancel and rerun reinitializeOSResolver

cancel and rerun reinitializeOSResolver

ignore invalid inferaces

ignore invalid inferaces

allow OS resolver upstream to fail

dont wait for dnsWait group on reinit, check for active interfaces to trigger reinit

fix unused var

simpler active iface check, debug logs

dont spam network service name patching on Mac

dont wait for os resolver nameserver testing

remove test for osresovlers for now

async nameserver testing

remove unused test
2025-01-20 15:03:27 +07:00
Alex PaguisandCuong Manh Le 7833132917 Don't automatically restore saved DNS settings when switching networks
smol tweaks to nameserver test queries

fix restoreDNS errors

add some debugging information

fix wront type in log msg

set send logs command timeout to 5 mins

when the runningIface is no longer up, attempt to find a new interface

prefer default route, ignore non physical interfaces

prefer default route, ignore non physical interfaces

add max context timeout on performLeakingQuery with more debug logs
2025-01-20 14:59:31 +07:00
Alex PaguisandCuong Manh Le 0bb8703f78 Update document for new client_id_preference param 2023-12-06 15:33:05 +07:00