forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux: Disable bond0 creation by bonding driver
Linux defaults to creating a `bond0` interface when modprobing the `bonding` driver, because the `max_bonds` option defaults to `1`¹. This `bond0` interface is created with the default bond mode `balance-rr`, which is most often undesirable. Networkd in turn is unable to change this mode, since it does not implement netdev recreation on parameter mismatch². If we instead default `max_bonds=0` the driver will be loaded, but no default interface will be created, leaving networkd in a better position to set up the network configuration. [1] https://www.kernel.org/doc/Documentation/networking/bonding.txt [2] systemd/systemd#9627
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
pkgs/os-specific/linux/kernel/bonding-dont-create-bond0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Prevent the bonding driver to create a bond0 interface by default when | ||
loaded, as that conflicts with declarative configuration management and | ||
instead feels much like a side-effect. | ||
|
||
|
||
diff --git a/include/uapi/linux/if_bonding.h b/include/uapi/linux/if_bonding.h | ||
index d174914a837d..bf8e2af101a3 100644 | ||
--- a/include/uapi/linux/if_bonding.h | ||
+++ b/include/uapi/linux/if_bonding.h | ||
@@ -82,7 +82,7 @@ | ||
#define BOND_STATE_ACTIVE 0 /* link is active */ | ||
#define BOND_STATE_BACKUP 1 /* link is backup */ | ||
|
||
-#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ | ||
+#define BOND_DEFAULT_MAX_BONDS 0 /* Default maximum number of devices to support */ | ||
|
||
#define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters