[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1010020030590.2320@ja.ssi.bg>
Date: Sat, 2 Oct 2010 00:45:52 +0300 (EEST)
From: Julian Anastasov <ja@....bg>
To: Simon Horman <horms@...ge.net.au>
cc: lvs-devel@...r.kernel.org, netdev@...r.kernel.org,
netfilter@...r.kernel.org, netfilter-devel@...r.kernel.org,
Jan Engelhardt <jengelh@...ozas.de>,
Stephen Hemminger <shemminger@...tta.com>,
Wensong Zhang <wensong@...ux-vs.org>,
Patrick McHardy <kaber@...sh.net>
Subject: Re: [patch v2 07/12] [PATCH 07/12] IPVS: Add struct ip_vs_pe
Hello,
On Fri, 1 Oct 2010, Simon Horman wrote:
> ===================================================================
> --- lvs-test-2.6.orig/net/netfilter/ipvs/ip_vs_conn.c 2010-10-01 22:48:42.000000000 +0900
> +++ lvs-test-2.6/net/netfilter/ipvs/ip_vs_conn.c 2010-10-01 22:49:15.000000000 +0900
> @@ -148,6 +148,29 @@ static unsigned int ip_vs_conn_hashkey(i
> & ip_vs_conn_tab_mask;
> }
>
> +static unsigned int ip_vs_conn_hashkey_param(const struct ip_vs_conn_param *p)
> +{
> + if (p->pe && p->pe->hashkey_raw)
> + return p->pe->hashkey_raw(p, ip_vs_conn_rnd) &
> + ip_vs_conn_tab_mask;
> + return ip_vs_conn_hashkey(p->af, p->protocol, p->caddr, p->cport);
> +}
> +
> +static unsigned int ip_vs_conn_hashkey_conn(const struct ip_vs_conn *cp)
> +{
> + struct ip_vs_conn_param p;
> +
> + ip_vs_conn_fill_param(cp->af, cp->protocol, &cp->caddr, cp->cport,
> + NULL, 0, &p);
> +
cp->dest is optional, line should be
'if (cp->dest && cp->dest->svc->pe) {':
> + if (cp->dest->svc->pe) {
> + p.pe = cp->dest->svc->pe;
> + p.pe_data = cp->pe_data;
> + p.pe_data_len = cp->pe_data_len;
> + }
> +
> + return ip_vs_conn_hashkey_param(&p);
> +}
>
> @@ -359,7 +387,7 @@ struct ip_vs_conn *ip_vs_conn_out_get(co
> /*
> * Check for "full" addressed entries
> */
Here ip_vs_conn_out_get expects client data in
p->vaddr and p->vport (was daddr before) but ip_vs_conn_hashkey_param
hashes client data from p->caddr and p->cport:
> - hash = ip_vs_conn_hashkey(p->af, p->protocol, p->vaddr, p->vport);
> + hash = ip_vs_conn_hashkey_param(p);
>
> ct_read_lock(hash);
Regards
--
Julian Anastasov <ja@....bg>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists