Jesper Dangaard Brouer 63dca2c0b0 ipvs: Fix faulty IPv6 extension header handling in IPVS
IPv6 packets can contain extension headers, thus its wrong to assume
that the transport/upper-layer header, starts right after (struct
ipv6hdr) the IPv6 header.  IPVS uses this false assumption, and will
write SNAT & DNAT modifications at a fixed pos which will corrupt the
message.

To fix this, proper header position must be found before modifying
packets.  Introducing ip_vs_fill_iph_skb(), which uses ipv6_find_hdr()
to skip the exthdrs. It finds (1) the transport header offset, (2) the
protocol, and (3) detects if the packet is a fragment.

Note, that fragments in IPv6 is represented via an exthdr.  Thus, this
is detected while skipping through the exthdrs.

This patch depends on commit 84018f55a:
 "netfilter: ip6_tables: add flags parameter to ipv6_find_hdr()"
This also adds a dependency to ip6_tables.

Originally based on patch from: Hans Schillstrom

kABI notes:
Changing struct ip_vs_iphdr is a potential minor kABI breaker,
because external modules can be compiled with another version of
this struct.  This should not matter, as they would most-likely
be using a compiled-in version of ip_vs_fill_iphdr().  When
recompiled, they will notice ip_vs_fill_iphdr() no longer exists,
and they have to used ip_vs_fill_iph_skb() instead.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
2012-09-28 11:34:15 +09:00
..
2011-03-31 11:26:23 -03:00
2012-08-15 03:43:43 -07:00
2012-06-08 14:27:23 -07:00
2012-08-09 16:18:06 -07:00
2012-04-15 12:44:40 -04:00
2012-04-15 12:44:40 -04:00
2010-06-03 03:21:52 -07:00
2012-04-15 12:44:40 -04:00
2012-07-19 10:43:03 -07:00
2011-03-31 11:26:23 -03:00
2012-04-15 12:44:40 -04:00
2012-09-24 16:31:37 -04:00
2012-07-18 08:59:58 -07:00
2012-08-14 14:28:32 -07:00
2012-04-14 14:47:05 -04:00
2011-03-31 11:26:23 -03:00
2012-05-17 18:45:20 -04:00
2010-06-03 03:21:52 -07:00
2012-08-09 16:18:06 -07:00
2012-08-07 16:24:55 -07:00
2011-05-17 14:16:58 -04:00
2012-07-26 15:50:39 -07:00
2009-03-21 19:06:50 -07:00
2012-05-19 01:08:16 -04:00
2012-08-06 13:40:47 -07:00
2012-09-24 16:31:37 -04:00
2009-10-07 16:39:43 -04:00
2012-04-15 12:44:40 -04:00
2012-05-16 15:17:08 -04:00
2012-04-15 12:44:40 -04:00