about summary refs log tree commit diff
path: root/src/nm-system.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd@luon.net>2013-10-25 21:21:07 +0200
committerSjoerd Simons <sjoerd@luon.net>2013-10-25 21:21:07 +0200
commite83d1de9b746dbc078ac1cf45f1798e1bc6b7e2f (patch)
treec36a40d79a5ae7d2bbca7d240d0a6f664049b435 /src/nm-system.c
parent26283b4c9e5035574a6c168003e7f1da53a8f32a (diff)
parenta4256940da049f91bbbea5e53e469a59ea9c10f7 (diff)
Merge tag 'upstream/0.9.8.8' into experimental
Upstream version 0.9.8.8
Diffstat (limited to 'src/nm-system.c')
-rw-r--r--src/nm-system.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nm-system.c b/src/nm-system.c
index 1a2f9382..7f6de912 100644
--- a/src/nm-system.c
+++ b/src/nm-system.c
@@ -1603,6 +1603,16 @@ nm_system_add_bonding_master (const char *iface)
 
 	g_return_val_if_fail (iface != NULL, FALSE);
 
+	/* When the kernel loads the bond module, either via explicit modprobe
+	 * or automatically in response to creating a bond master, it will also
+	 * create a 'bond0' interface.  Since the bond we're about to create may
+	 * or may not be named 'bond0' prevent potential confusion about a bond
+	 * that the user didn't want by telling the bonding module not to create
+	 * bond0 automatically.
+	 */
+	if (!g_file_test ("/sys/class/net/bonding_masters", G_FILE_TEST_EXISTS))
+		nm_spawn_process ("modprobe bonding max_bonds=0");
+
 	sock = nm_netlink_get_default_handle ();
 
 	/* Existing bonding devices with matching name will be reused */