netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org,
	netdev@vger.kernel.org
Cc: Deon van der Merwe <dvdm@truteq.co.za>,
	Julian Anastasov <ja@ssi.bg>, Patrick McHardy <kaber@trash.net>
Subject: [patch] ipvs: fwmark services don't have ports
Date: Mon, 7 Dec 2009 14:55:05 +1100	[thread overview]
Message-ID: <20091207035505.GC419@verge.net.au> (raw)

Make sure that the port for fwmark services is always zero, it seems that
in some cases ipvsadm provides bogus port values for fwmark services.  As
observed by Deon van der Merwe, this manifests as a clients not being able
to connect to the virtual service if persistence is set.

Tested-by: Deon van der Merwe <dvdm@truteq.co.za>
Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

I believe that this fixes a bug and as such is suitable for -stable.
However, Its taken a few release for anyone to bring this to our attention,
so it doesn't seem to be causing much pain in the wild.

Discussion of this problem:
http://archive.linuxvirtualserver.org/html/lvs-users/2009-11/msg00043.html

diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index e01061f..9a4ccd4 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1188,8 +1188,9 @@ ip_vs_add_service(struct ip_vs_service_user_kern *u,
 	svc->af = u->af;
 	svc->protocol = u->protocol;
 	ip_vs_addr_copy(svc->af, &svc->addr, &u->addr);
-	svc->port = u->port;
 	svc->fwmark = u->fwmark;
+	if (!svc->fwmark)
+		svc->port = u->port;
 	svc->flags = u->flags;
 	svc->timeout = u->timeout * HZ;
 	svc->netmask = u->netmask;

             reply	other threads:[~2009-12-07  3:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07  3:55 Simon Horman [this message]
2009-12-07  8:48 ` [patch] ipvs: fwmark services don't have ports Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091207035505.GC419@verge.net.au \
    --to=horms@verge.net.au \
    --cc=dvdm@truteq.co.za \
    --cc=ja@ssi.bg \
    --cc=kaber@trash.net \
    --cc=lvs-devel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).