Skip to content

ipvlan: add "flag" option to select bridge, private or vepa - #1321

Open
officialasishkumar wants to merge 1 commit into
containernetworking:mainfrom
officialasishkumar:ipvlan-flag-config
Open

officialasishkumar wants to merge 1 commit into
containernetworking:mainfrom
officialasishkumar:ipvlan-flag-config

Conversation

@officialasishkumar

Copy link
Copy Markdown

Adds an optional flag field to the ipvlan plugin configuration, accepting bridge (default), private or vepa. It maps to the kernel's IFLA_IPVLAN_FLAG and is passed to netlink at link creation. Unknown values are rejected. CHECK now verifies the flag on the container interface matches the configured one. Unset behaves as before (bridge).

Tests (Ginkgo): link creation for each flag with the resulting link's flag verified, full ADD/CHECK/DEL for each flag, and rejection of an unknown value. Ran the ipvlan suite with -race as root in a privileged container; all 24 specs pass.

The user-facing docs live in containernetworking/cni.dev, so the new option still needs a matching entry there.

Fixes #1032

The ipvlan driver in the kernel supports three flags that control how
slaves of the same master interact (IFLA_IPVLAN_FLAG): "bridge" (the
default), "private" and "vepa". The plugin always created links with the
default, leaving no way to isolate ipvlan slaves from each other or to
force their traffic through an external switch.

Add an optional "flag" field to the network configuration, accepting
"bridge" (also the default when unset), "private" or "vepa". The value
is passed to netlink when the link is created, and unknown values are
rejected. CHECK now also verifies that the flag on the container
interface matches the configured one.

Tests cover link creation for every flag, the full ADD/CHECK/DEL cycle
for each flag, and rejection of an unknown value.

Fixes containernetworking#1032

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
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.

feature: support flag configuration for ipvlan

1 participant