code: func CheckRelayIP(sender, addr net.IP) error {
  	if len(addr) != net.IPv4len && len(addr) != net.IPv6len {
  		return errInvalid
  	}
  	if addr.IsUnspecified() {
  		return errUnspecified
  	}
  	if IsSpecialNetwork(addr) {
  		return errSpecial
  	}
  	if addr.IsLoopback() && !sender.IsLoopback() {
  		return errLoopback
  	}
  	if IsLAN(addr) && !IsLAN(sender) {
  		return errLAN
  	}
  	return nil
  }
docs: // CheckRelayIP reports whether an IP relayed from the given sender IP
  // is a valid connection target.
  //
  // There are four rules:
  //   - Special network addresses are never valid.
  //   - Loopback addresses are OK if relayed by a loopback host.
  //   - LAN addresses are OK if relayed by a LAN host.
  //   - All other addresses are always acceptable.