All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libipvs: Fix initialization of netlink (needed for IPv6)
@ 2012-02-09 14:00 Anders Henke
  0 siblings, 0 replies; only message in thread
From: Anders Henke @ 2012-02-09 14:00 UTC (permalink / raw)
  To: lvs-devel

[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]

Hi,

we've been investigating a few minor issues with LVS and keepalived; a 
freelance developer at my team also prepared a couple of smaller patches 
to resolve those issues we'd like to contribute to the general LVS public.

=== Fix Netlink Init

When the kernel module for ip_vs hasn't been loaded yet and an
application (say, keepalived) tries to call ipvs, IPVS assumes
netlink not to be present and triggers another load attempt
of the kernel module, but without re-testing for netlink.
In the end, netlink isn't being used. However, netlink is essential
for running IPVS with IPv6.

Attached is a oneline-patch for libipvs to adress this issue; it is
based upon commit 91c61a85dccffd00dd6e887d24302443e412433d from
http://master.formilux.org/git/people/alex/keepalived.git,
but is simple enough to be applied to almost any other
release of libipvs as well.

As it's directly related to keepalived and they do seem to keep their own
copy of libipvs, I'll post this patch to keepalived-devel as well
(among a few other patches).


Best,

Anders
-- 
1&1 Internet AG              Expert Systems Architect (IT Operations)
Brauerstrasse 48             v://49.721.91374.0
D-76135 Karlsruhe            f://49.721.91374.225

Amtsgericht Montabaur HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Robert Hoffmann,
Markus Huhn, Hans-Henning Kettler, Dr. Oliver Mauss, Jan Oetjen

Aufsichtsratsvorsitzender: Michael Scheeren


[-- Attachment #2: 0001-libipvs-Fix-initialization-of-netlink-needed-for-IPv.patch --]
[-- Type: text/x-diff, Size: 1036 bytes --]

From cf8ff745812b7fe00d509fb50592348b6f60b433 Mon Sep 17 00:00:00 2001
From: Alexander Holler <alexander.holler@1und1.de>
Date: Mon, 9 Jan 2012 12:58:12 +0100
Subject: [PATCH] libipvs: Fix initialization of netlink (needed for IPv6)
 when the module ip_vs wasn't loaded.

The following happened when keepalived was started before the module for IPVS was loaded:

ipvs_init() failed => netlink got disabled.
modprobe_ipvs()
ipvs_init() => netlink was not tested again => no netlink => no IPv6

Fixed through testing netlink always in ipvs_init().
---
 keepalived/libipvs-2.6/libipvs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/keepalived/libipvs-2.6/libipvs.c b/keepalived/libipvs-2.6/libipvs.c
index 2c75118..ea5e851 100644
--- a/keepalived/libipvs-2.6/libipvs.c
+++ b/keepalived/libipvs-2.6/libipvs.c
@@ -114,6 +114,8 @@ int ipvs_init(void)
 	ipvs_func = ipvs_init;
 
 #ifdef LIBIPVS_USE_NL
+	try_nl = 1;
+
 	if (ipvs_nl_send_message(NULL, NULL, NULL) == 0) {
 		return ipvs_getinfo();
 	}
-- 
1.7.6.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-09 14:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-09 14:00 [PATCH] libipvs: Fix initialization of netlink (needed for IPv6) Anders Henke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.