Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd-networkd: add configuration for XFRM interfaces #77665

Merged
merged 1 commit into from Jan 21, 2020

Conversation

zaninime
Copy link
Contributor

@zaninime zaninime commented Jan 14, 2020

Motivation for this change

Add the option(s) to create and manage XFRM interfaces via systemd-networkd. All the options have been added. Tested on a system running 19.09.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@andir andir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I do not have any Xfrm setup where I could have tested this tho...

@@ -172,6 +172,14 @@ let
(assertValueOneOf "AllSlavesActive" boolValues)
];

checkXfrm = checkUnitConfig "Xfrm" [
(assertOnlyFields [
"InterfaceId" "Independent"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay according to the man pages usage of the Xfrm section:

[XFRM] SECTION OPTIONS
       The "[Xfrm]" section accepts the following keys:

       InterfaceId=
           Sets the ID/key of the xfrm interface which needs to be associated with a SA/policy. Can be decimal or hexadecimal, valid range is 0-0xffffffff,
           defaults to 0.

       Independent=
           Takes a boolean. If set to "no", the xfrm interface should have an underlying device which can be used for hardware offloading. Defaults to
           "no". See systemd.network(5) for how to configure the underlying device.

       For more detail information see Virtual xfrm interfaces[16]

This does not look complete when looking at the examples:


           [Xfrm]
           Name=xfrm0
           Kind=xfrm

           [Xfrm]
           Independent=yes

I guess that first [Xfrm] there should have have been [NetDev] then everything checks out.

I filed an upstream PR: systemd/systemd#14630

@flokli flokli merged commit a3d67f4 into NixOS:master Jan 21, 2020
@zaninime zaninime deleted the ifxfrm branch July 30, 2022 16:36
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.

None yet

3 participants