8000 Crash when port > 65535 · Issue #6584 · utmapp/UTM · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Crash when port > 65535 #6584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Galoula opened this issue Aug 20, 2024 · 0 comments
Closed

Crash when port > 65535 #6584

Galoula opened this issue Aug 20, 2024 · 0 comments

Comments

@Galoula
Copy link
Galoula commented Aug 20, 2024

BEFORE SUBMITTING YOUR ISSUE, PLEASE LOOK AT THE PINNED ISSUES AND USE THE SEARCH FUNCTION TO MAKE SURE IT IS NOT ALREADY REPORTED. ALWAYS COMMENT ON AN EXISTING ISSUE INSTEAD OF MAKING A NEW ONE.

Describe the issue
Going to server > Allow access for external clients > port and put an port more than 65535.

Configuration

  • UTM Version: Version 4.5.3 (99)
  • macOS Version: 14.5 (23F79)
  • Mac Chip (Intel, M1, ...): M1

I didn't foubnd where is the settings file to reset my mistake - UTM crash directly, so I can't change from GUI.
To resolv myself, I make UTM from source, remove server part (comment in UTMRemoteServer), and roll back settings to a good port.
You will just need check if port if not gratter than 65535.

    func start() async {
        do {
            try await center.requestAuthorization(options: .alert)
        } catch {
            logger.error("Failed to authorize notifications.")
        }
        await withErrorNotification {
            guard await !state.isServerActive else {
                return
            }
            try await keyManager.load()
            await state.setServerFingerprint(keyManager.fingerprint!)
            registerNotifications()
            listener = Task {
                await withErrorNotification {
                    /*
                    if isServerExternal && serverPort > 0 {
                        natPort = Port.TCP(internalPort: UInt16(serverPort))
                        natPort!.mappingChangedHandler = { port in
                            Task {
                                let address = try? await port.externalIpv4Address
                                let port = try? await port.externalPort
                                await self.state.setExternalAddress(address, port: port)
                            }
                        }
                        await withErrorNotification {
                            guard try await natPort!.externalPort == serverPort else {
                                throw ServerError.natReservationMismatch(serverPort)
                            }
                        }
                    }
                    let port = serverPort > 0 ? NWEndpoint.Port(integerLiteral: UInt16(serverPort)) : .any
                    for try await connection in Connection.advertise(on: port, forServiceType: service, txtRecord: metadata, connectionQueue: connectionQueue, identity: keyManager.identity) {
                        let connection = try? await Connection(connection: connection, connectionQueue: connectionQueue) { connection, error in
                            Task {
                                guard let fingerprint = connection.fingerprint else {
                                    return
                                }
                                if !(error is NWError) {
                                    // connection errors are too noisy
                                    await self.notifyError(error)
                                }
                                await self.state.disconnect(fingerprint)
                            }
                        }
                        if let connection = connection {
                            await newRemoteConnection(connection)
                        }
                    }
                     */
                }
                natPort = nil
                await stop()
            }
            await state.setServerActive(true)
        }
    }

Regards,

Gaël

@osy osy closed this as completed in 6bb5b20 Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0