Skip to content

tc (from sys-apps/iproute2) fails to load BPF code #172

@alban

Description

@alban

Current situation
On alpha, 2605.0.0:

$ tc filter add dev bond0 egress bpf da obj mybpf.elf sec filter_egress
No ELF library support compiled in.

Impact
I cannot setup traffic control with BPF code using the iproute2 tools included in the Flatcar OS image.

Workaround
I can use tc from a container. Example:

docker run -ti --rm \
    --net=host \
    -v /:/host ubuntu \
    sh -c "apt-get update ; apt-get install -y iproute2 ; tc filter add dev bond0 egress bpf da obj /host/$PWD/mybpf.elf sec filter_egress"

Ideal future situation
tc is compiled with libelf and can load BPF programs.

Implementation options
See how to compile iproute2 with libelf:
https://github.com/shemminger/iproute2/blob/ea6aeeb90cdbabe0ddf9e30b183ba9ffbf0dbbba/configure#L232-L240

Additional information
Applications running in containers are not affected, since they normally include iptables with the compilation options they need.

Same bug in other distros:

/cc @mauriciovasquezbernal

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions