From 7cc95d89a6061fc18ab16e7f8462aaf7ae4e77a8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 26 Apr 2013 17:29:06 -0500 Subject: [PATCH] core: suppress kernel's automatic creation of bond0 (rh #953466) Which it does whenever the 'bonding' module gets loaded no matter what name the user wants to give the new bond interface. --- src/nm-system.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/nm-system.c b/src/nm-system.c index 63e762bc6..27b241050 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -1602,6 +1602,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 */