From 035509dc9fcc06b03bac6016e338033d10c3fb3a Mon Sep 17 00:00:00 2001 From: Vadim Kurland Date: Fri, 29 Oct 2010 14:51:51 -0700 Subject: [PATCH] * OSConfigurator_bsd.cpp (compare_names): fixed #1807 "wrong order of address assignment in the generated OpenBSD/PF/CARP cluster configuration". Need to assign ip addresses to regular interfaces before trying to assign them to carp interfaces. --- doc/ChangeLog | 5 +++++ src/pflib/OSConfigurator_bsd.cpp | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index c28c421a8..c534cb605 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,10 @@ 2010-10-29 Vadim Kurland + * OSConfigurator_bsd.cpp (compare_names): fixed #1807 "wrong order + of address assignment in the generated OpenBSD/PF/CARP cluster + configuration". Need to assign ip addresses to regular interfaces + before trying to assign them to carp interfaces. + * configlets/linux24/load_modules: fixed #1820 "skip module "nf_conntrack_ipv6" if generated script has no ipv6 rules" Shell function load_modules should not try to load module diff --git a/src/pflib/OSConfigurator_bsd.cpp b/src/pflib/OSConfigurator_bsd.cpp index e77b5e63d..014100797 100644 --- a/src/pflib/OSConfigurator_bsd.cpp +++ b/src/pflib/OSConfigurator_bsd.cpp @@ -212,11 +212,18 @@ string OSConfigurator_bsd::printFunctions() return ostr.str(); } - +/* + * We need to sort interfaces by name but make sure carp interfaces + * are always last. See #1807 + */ bool compare_names(FWObject *a, FWObject *b) { - if (a->getName() < b->getName()) return true; - return false; + QString a_name = QString(a->getName().c_str()); + QString b_name = QString(b->getName().c_str()); + if (a_name.startsWith("carp") && b_name.startsWith("carp")) return a_name < b_name; + if (a_name.startsWith("carp")) return false; + if (b_name.startsWith("carp")) return true; + return a_name < b_name; } string OSConfigurator_bsd::configureInterfaces()