mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
nixos/networkd: add PFIFOHeadDrop options
This commit is contained in:
parent
d9e1963a15
commit
f75ec30fee
@ -1180,7 +1180,7 @@ let
|
||||
"LimitBytes"
|
||||
])
|
||||
];
|
||||
};
|
||||
|
||||
sectionPFIFO = checkUnitConfig "PFIFO" [
|
||||
(assertOnlyFields [
|
||||
"Parent"
|
||||
@ -1190,6 +1190,16 @@ let
|
||||
(assertInt "PacketLimit")
|
||||
(assertRange "PacketLimit" 0 4294967294)
|
||||
];
|
||||
|
||||
sectionPFIFOHeadDrop = checkUnitConfig "PFIFOHeadDrop" [
|
||||
(assertOnlyFields [
|
||||
"Parent"
|
||||
"Handle"
|
||||
"PacketLimit"
|
||||
])
|
||||
(assertInt "PacketLimit")
|
||||
(assertRange "PacketLimit" 0 4294967294)
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@ -1957,6 +1967,17 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
pfifoHeadDropConfig = mkOption {
|
||||
default = {};
|
||||
example = { Parent = "ingress"; PacketLimit = "300"; };
|
||||
type = types.addCheck (types.attrsOf unitOption) check.network.sectionPFIFOHeadDrop;
|
||||
description = lib.mdDoc ''
|
||||
Each attribute in this set specifies an option in the
|
||||
`[PFIFOHeadDrop]` section of the unit. See
|
||||
{manpage}`systemd.network(5)` for details.
|
||||
'';
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
@ -2424,6 +2445,10 @@ let
|
||||
[PFIFO]
|
||||
${attrsToSection def.pfifoConfig}
|
||||
''
|
||||
+ optionalString (def.pfifoHeadDropConfig != { }) ''
|
||||
[PFIFOHeadDrop]
|
||||
${attrsToSection def.pfifoHeadDropConfig}
|
||||
''
|
||||
+ def.extraConfig;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user