Skip to content

driver: fix VLAN protocol byte order on big-endian systems - #334

Open
omrzk wants to merge 1 commit into
jsimonetti:masterfrom
omrzk:fix/vlan-protocol-network-byte-order
Open

omrzk wants to merge 1 commit into
jsimonetti:masterfrom
omrzk:fix/vlan-protocol-network-byte-order

Conversation

@omrzk

@omrzk omrzk commented Oct 26, 2026 •

Copy link
Copy Markdown

VLAN and bridge VLAN protocol attributes are network-endian, but the drivers used native-endian integers with byte-swapped constants. This produces 00 81 instead of 81 00 for 802.1Q on s390x, and decoding a kernel response does not recognize the protocol.

Use canonical EtherType constants (0x8100/0x88a8) and network byte order for these payloads, preserving the surrounding native-endian attributes. Also make the four bridge raw fixtures native-endian so they can run on s390x; these reproduce the failures in #292.

The exported constants' numeric values change; callers using the named constants retain the intended protocol and wire bytes on little-endian hosts. Callers using the previous byte-swapped numeric literals should use the named constants.

Validation: the new regression fails on the original code and passes with the fix for both VLAN drivers, both protocols and both byte orders. Full native go test -race -shuffle=on -cover ./..., full Linux/s390x fixture suite under qemu-user, go vet ./..., go build -tags=gofuzz ./..., and golangci-lint 2.15.0 pass. No privileged live interface creation was run; this host has no effective capabilities.

Fixes #292.

@omrzk
omrzk marked this pull request as draft October 26, 2026 14:13
Signed-off-by: omrzk <193513049+omrzk@users.noreply.github.com>
@omrzk
omrzk force-pushed the fix/vlan-protocol-network-byte-order branch from 26b964e to e7a69cb Compare October 27, 2026 04:48
@omrzk
omrzk marked this pull request as ready for review October 27, 2026 04:49
@omrzk

omrzk commented Oct 27, 2026

Copy link
Copy Markdown
Author

The Go 1.25 vulnerability job fails while installing govulncheck, before scanning this code: golang.org/x/vuln@v1.9.0 requires go >= 1.26.0 (running go 1.25.14; GOTOOLCHAIN=local). The workflow installs govulncheck@latest and is unchanged from master 9498c7a; this PR changes neither the workflow nor dependencies.

Both Linux integration jobs and both macOS test jobs pass on Go 1.25/1.26, as do lint and DCO. The Go 1.26 vulnerability job is marked canceled, so the overall workflow is still not green. I have left the VLAN patch focused; the scanner/toolchain compatibility needs a separate CI fix.

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.

Bridge test functions fail on s390x

1 participant