Skip to content

Add PCI address validation to generate_if_map - #735

Merged
AltraMayor merged 2 commits into
masterfrom
if_map
Sep 18, 2026
Merged

AltraMayor merged 2 commits into
masterfrom
if_map

Conversation

@AltraMayor

Copy link
Copy Markdown
Owner

Add PCI address validation to the mapping and update .gitignore to exclude build artifacts.

Michel Machado added 2 commits September 17, 2026 22:26
Running setup.sh and compiling Gatekeeper during development creates
several binaries, build artifacts, and runtime configuration files that
are untracked by git.

Add the following patterns to .gitignore to keep the repository clean:
- *.bpf: compiled BPF programs in bpf/ and lua/bpf/
- build/: Gatekeeper compilation output directory
- generate_if_map: interface-to-PCI mapping generator binary
- gkctl/gkctl: Gatekeeper control client binary
- lua/bpf/: directory holding installed BPF programs
- lua/if_map.lua: generated interface-to-PCI mapping file
Virtual network interfaces such as Linux bridges (e.g. br0, lxcbr0) do
not have a physical PCI bus address. When queried with ETHTOOL_GDRVINFO,
the kernel bridge driver reports "N/A" for bus_info, and other virtual
devices may fail the SIOCETHTOOL ioctl entirely. This previously caused
non-PCI entries to be emitted into the interface map Lua file.

Validate the bus information using sscanf to ensure it matches the PCI
domain:bus:dev.func format. When an interface fails the ioctl or does
not have a valid PCI address, report it to stderr and omit it from the
generated mapping.
@AltraMayor AltraMayor added this to the Version 1.3 milestone Sep 18, 2026
@AltraMayor
AltraMayor merged commit b7de343 into master Sep 18, 2026
1 check passed
@AltraMayor
AltraMayor deleted the if_map branch September 18, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant