linux/net/netfilter/ipvs
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
..
ip_vs_app.c ipvs: generalize app registration in netns 2012-08-10 10:34:51 +09:00
ip_vs_conn.c ipvs: optimize the use of flags in ip_vs_bind_dest 2012-05-08 19:40:49 +02:00
ip_vs_core.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
ip_vs_ctl.c Merge branch 'master' of git://1984.lsi.us.es/nf-next 2012-09-13 14:24:31 -04:00
ip_vs_dh.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
ip_vs_est.c IPVS: remove unused init and cleanup functions. 2011-06-14 09:07:32 +09:00
ip_vs_ftp.c netfilter: nf_nat: add protoff argument to packet mangling functions 2012-08-30 03:00:13 +02:00
ip_vs_lblc.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
ip_vs_lblcr.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
ip_vs_lc.c ipvs: unify the formula to estimate the overhead of processing connections 2011-02-25 11:35:41 +09:00
ip_vs_nfct.c ipvs: Remove unused parameter from ip_vs_confirm_conntrack() 2011-11-01 09:19:29 +01:00
ip_vs_nq.c ipvs: make "no destination available" message more informative 2011-02-16 14:53:33 +09:00
ip_vs_pe_sip.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
ip_vs_pe.c IPVS: Backup, Adding Version 1 receive capability 2010-11-25 10:42:59 +09:00
ip_vs_proto_ah_esp.c IPVS: netns, connection hash got net as param. 2011-01-13 10:30:28 +09:00
ip_vs_proto_sctp.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
ip_vs_proto_tcp.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
ip_vs_proto_udp.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
ip_vs_proto.c ipvs: Trivial changes, use compressed IPv6 address in output 2012-09-28 11:33:52 +09:00
ip_vs_rr.c ipvs: make "no destination available" message more informative 2011-02-16 14:53:33 +09:00
ip_vs_sched.c ipvs: Trivial changes, use compressed IPv6 address in output 2012-09-28 11:33:52 +09:00
ip_vs_sed.c ipvs: make "no destination available" message more informative 2011-02-16 14:53:33 +09:00
ip_vs_sh.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
ip_vs_sync.c ipvs: add support for sync threads 2012-05-08 19:40:33 +02:00
ip_vs_wlc.c ipvs: unify the formula to estimate the overhead of processing connections 2011-02-25 11:35:41 +09:00
ip_vs_wrr.c ipvs: WRR scheduler does not need GFP_ATOMIC allocation 2012-05-08 19:37:22 +02:00
ip_vs_xmit.c ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
Kconfig ipvs: Fix faulty IPv6 extension header handling in IPVS 2012-09-28 11:34:15 +09:00
Makefile IPVS: sip persistence engine 2010-10-04 22:45:24 +09:00