OpenCloudOS-Kernel/net/netfilter/ipvs
Simon Horman be8be9eccb ipvs: Fix IPv4 FWMARK virtual services
This fixes the use of fwmarks to denote IPv4 virtual services
which was unfortunately broken as a result of the integration
of IPv6 support into IPVS, which was included in 2.6.28.

The problem arises because fwmarks are stored in the 4th octet
of a union nf_inet_addr .all, however in the case of IPv4 only
the first octet, corresponding to .ip, is assigned and compared.

In other words, using .all = { 0, 0, 0, htonl(svc->fwmark) always
results in a value of 0 (32bits) being stored for IPv4. This means
that one fwmark can be used, as it ends up being mapped to 0, but things
break down when multiple fwmarks are used, as they all end up being mapped
to 0.

As fwmarks are 32bits a reasonable fix seems to be to just store the fwmark
in .ip, and comparing and storing .ip when fwmarks are used.

This patch makes the assumption that in calls to ip_vs_ct_in_get()
and ip_vs_sched_persist() if the proto parameter is IPPROTO_IP then
we are dealing with an fwmark. I believe this is valid as ip_vs_in()
does fairly strict filtering on the protocol and IPPROTO_IP should
not be used in these calls unless explicitly passed when making
these calls for fwmarks in ip_vs_sched_persist().

Tested-by: Fabien Duchêne <fabien.duchene@student.uclouvain.be>
Cc: Joseph Mack NA3T <jmack@wm7d.net>
Cc: Julius Volz <julius.volz@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-08 14:54:47 -07:00
..
Kconfig ipvs: Update CONFIG_IP_VS_IPV6 description and help text 2008-10-19 23:29:56 -07:00
Makefile IPVS: Move IPVS to net/netfilter/ipvs 2008-10-07 08:38:24 +11:00
ip_vs_app.c IPVS: Move IPVS to net/netfilter/ipvs 2008-10-07 08:38:24 +11:00
ip_vs_conn.c ipvs: Fix IPv4 FWMARK virtual services 2009-05-08 14:54:47 -07:00
ip_vs_core.c ipvs: Fix IPv4 FWMARK virtual services 2009-05-08 14:54:47 -07:00
ip_vs_ctl.c net: '&' redux 2008-11-03 18:21:05 -08:00
ip_vs_dh.c IPVS: Remove supports_ipv6 scheduler flag 2008-11-03 17:08:56 -08:00
ip_vs_est.c IPVS: Move IPVS to net/netfilter/ipvs 2008-10-07 08:38:24 +11:00
ip_vs_ftp.c net: replace NIPQUAD() in net/netfilter/ 2008-10-31 00:54:29 -07:00
ip_vs_lblc.c IPVS: Make "no destination available" message more consistent between schedulers 2008-12-29 18:37:36 -08:00
ip_vs_lblcr.c IPVS: Make "no destination available" message more consistent between schedulers 2008-12-29 18:37:36 -08:00
ip_vs_lc.c IPVS: Make "no destination available" message more consistent between schedulers 2008-12-29 18:37:36 -08:00
ip_vs_nq.c IPVS: Make "no destination available" message more consistent between schedulers 2008-12-29 18:37:36 -08:00
ip_vs_proto.c net: replace NIPQUAD() in net/netfilter/ 2008-10-31 00:54:29 -07:00
ip_vs_proto_ah_esp.c net: replace NIPQUAD() in net/netfilter/ 2008-10-31 00:54:29 -07:00
ip_vs_proto_tcp.c ipvs: oldlen, newlen should be be16, not be32 2008-11-06 23:09:56 -08:00
ip_vs_proto_udp.c ipvs: oldlen, newlen should be be16, not be32 2008-11-06 23:09:56 -08:00
ip_vs_rr.c IPVS: Make "no destination available" message more consistent between schedulers 2008-12-29 18:37:36 -08:00
ip_vs_sched.c IPVS: Move IPVS to net/netfilter/ipvs 2008-10-07 08:38:24 +11:00
ip_vs_sed.c IPVS: Make "no destination available" message more consistent between schedulers 2008-12-29 18:37:36 -08:00
ip_vs_sh.c IPVS: Make "no destination available" message more consistent between schedulers 2008-12-29 18:37:36 -08:00
ip_vs_sync.c net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
ip_vs_wlc.c IPVS: Make "no destination available" message more consistent between schedulers 2008-12-29 18:37:36 -08:00
ip_vs_wrr.c IPVS: Make "no destination available" message more consistent between schedulers 2008-12-29 18:37:36 -08:00
ip_vs_xmit.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-11-11 15:43:02 -08:00