Skip to content

Revival: Support for Modern Linux Kernels & Netlink Integration#6

Open
mnietona wants to merge 108 commits into
GregoryVds:masterfrom
mnietona:fix/compilation-modern-linux
Open

Revival: Support for Modern Linux Kernels & Netlink Integration#6
mnietona wants to merge 108 commits into
GregoryVds:masterfrom
mnietona:fix/compilation-modern-linux

Conversation

@mnietona
Copy link
Copy Markdown

@mnietona mnietona commented Nov 19, 2025

Context & Motivation

This project hasn't seen updates since 2018. As a result, the codebase was no longer compilable or executable on modern Linux distributions (tested on Ubuntu 24.04, kernel 6.x) due to:

  • Stricter modern compiler flags (GCC).
  • Deprecation and removal of older network protocols in recent Linux kernel headers.
  • Outdated build configurations.

This PR revives the project, making it functional on modern systems, and extends its architecture by introducing Netlink support.

Key Changes

1. Modernization & Compilation Fixes

  • Protocol Cleanup: Removed dependencies on obsolete legacy protocols (IPX, IRDA, etc.) in constants.h and sockopt_levels.h which are no longer present in modern Linux headers.
  • Build System: Updated the Makefile to use the gnu11 standard. Adjusted flags to handle implicit function declarations and type conversions allowed in older C standards but flagged by modern GCC.

2. New Feature: Netlink Integration

  • Added Netlink Support: Implemented Netlink communication to communicate with the kernel.

Verification

The tool is now fully compilable and functional on Ubuntu 24.04.

Test Case performed:

tcpsnitch -n -d ~/trace curl [https://google.com](https://google.com)

@mnietona mnietona changed the title Fix compilation on modern Linux (Ubuntu 24.04) Revival: Support for Modern Linux Kernels & Netlink Integration Dec 1, 2025
@mnietona mnietona force-pushed the fix/compilation-modern-linux branch from 6266638 to d9e9080 Compare December 3, 2025 18:08
mnietona added 18 commits March 2, 2026 19:30
- C Core: Implemented DRY principles in json_builder.c and sock_events.c,
  reducing boilerplate by 70% using macro-based event builders.
- Shell: Hardened bin/tcpsnitch script (Shellcheck SC2155, SC2206, SC2046,
  SC2164 compliance) for better error handling and portability.
- Static Analysis: Fixed all Cppcheck/Scan-build warnings, including
  variable scope reduction, const-correctness, and BPF macro guards.
- Portability: Reinforced Android platform guards across init.c and lib.c.
- Build System: Updated Makefile and PKGBUILD for cleaner dependency
  management and eBPF support.
- Formatting: Standardized whole codebase with clang-format (LLVM style).
- Cleanup: Removed dead code and obsolete .devcontainer configurations.
@mnietona mnietona force-pushed the fix/compilation-modern-linux branch from 9f3d77b to 446d7bf Compare April 27, 2026 11:59
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

Successfully merging this pull request may close these issues.

1 participant