Add netquality 1.1.2 client and node behavior.
Show the address actually probed, keep address-selection misses out of formal loss, and add session metrics, a stop summary, pinned chart points, and in-app metric and release-history screens. Client version is 1.1.2+5. Attribution remains 言灸 under AGPL-3.0-only. Co-authored-by: yanjiu0721 <yanjiu0721@users.noreply.github.com>
This commit is contained in:
1 parent
8ca2185c01
commit
aeb08ec049
40 files changed
+3827
-545
No files matched your search
+12
-3
@@ -25,8 +25,17 @@ var metadataIP = net.ParseIP("169.254.169.254")
|
||||
// Loopback, private, link-local and cloud metadata are rejected unless
|
||||
// allowPrivate is set. Metadata addresses stay blocked either way.
|
||||
// Every resolved address is checked so a later DNS answer cannot rebind
|
||||
// the dial onto a forbidden IP; the caller dials only the returned IP.
|
||||
// the dial onto a forbidden IP. targetOK returns the first allowed address;
|
||||
// resolveTargets returns every allowed address in resolver order.
|
||||
func targetOK(ctx context.Context, resolver resolver, host string, allowPrivate bool, extra []*net.IPNet) (net.IP, error) {
|
||||
ips, err := resolveTargets(ctx, resolver, host, allowPrivate, extra)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ips[0], nil
|
||||
}
|
||||
|
||||
func resolveTargets(ctx context.Context, resolver resolver, host string, allowPrivate bool, extra []*net.IPNet) ([]net.IP, error) {
|
||||
host = strings.TrimSpace(host)
|
||||
host = strings.Trim(host, "[]")
|
||||
if host == "" {
|
||||
@@ -39,7 +48,7 @@ func targetOK(ctx context.Context, resolver resolver, host string, allowPrivate
|
||||
if !ipAllowed(ip, allowPrivate, extra) {
|
||||
return nil, fmt.Errorf("%w: %s", errForbiddenTarget, ip.String())
|
||||
}
|
||||
return ip, nil
|
||||
return []net.IP{ip}, nil
|
||||
}
|
||||
if resolver == nil {
|
||||
resolver = net.DefaultResolver
|
||||
@@ -65,7 +74,7 @@ func targetOK(ctx context.Context, resolver resolver, host string, allowPrivate
|
||||
if len(allowed) != len(addrs) {
|
||||
return nil, fmt.Errorf("%w: %s resolved to a mix of public and blocked addresses", errForbiddenTarget, host)
|
||||
}
|
||||
return allowed[0], nil
|
||||
return allowed, nil
|
||||
}
|
||||
|
||||
func ipAllowed(ip net.IP, allowPrivate bool, extra []*net.IPNet) bool {
|
||||
|
||||
Reference in new issue
Block a user