Skip to content

fix: add --max-clients option to limit concurrent network connections - #300

Open
zagers wants to merge 1 commit into
flightaware:masterfrom
zagers:fix/connection-limit
Open

fix: add --max-clients option to limit concurrent network connections#300
zagers wants to merge 1 commit into
flightaware:masterfrom
zagers:fix/connection-limit

Conversation

@zagers

@zagers zagers commented Jul 18, 2026

Copy link
Copy Markdown

Summary

Adds a configurable --max-clients option to limit the number of simultaneous TCP clients connecting to dump1090.

Changes

  • dump1090.h: Added max_clients and client_count fields to the Modes struct
  • dump1090.c: Added --max-clients <n> CLI option parsing and help text
  • net_io.c:
    • Track global client count via Modes.client_count
    • Reject new connections in modesAcceptClients() when Modes.client_count >= Modes.max_clients

Usage

dump1090 --net --max-clients 100

Default is 0 (unlimited), preserving backward compatibility.

Motivation

Without a connection limit, an attacker can open thousands of TCP connections, exhausting memory and file descriptors. Each connection consumes ~1KB of memory and is polled on every network cycle, causing CPU degradation and service unavailability.

Fixes #298

Prevents resource exhaustion DoS by allowing a configurable limit on
the number of simultaneous TCP clients. Connections are rejected when
the limit is reached.

Fixes flightaware#298
@mutability mutability added the LLM has LLM-generated content, treat with extreme suspicion label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM has LLM-generated content, treat with extreme suspicion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No connection limit on TCP listeners enables denial of service

2 participants