linux/net/netfilter/ipvs
Patrick McHardy 4cdd34084d netfilter: nf_conntrack_ipv6: improve fragmentation handling
The IPv6 conntrack fragmentation currently has a couple of shortcomings.
Fragmentes are collected in PREROUTING/OUTPUT, are defragmented, the
defragmented packet is then passed to conntrack, the resulting conntrack
information is attached to each original fragment and the fragments then
continue their way through the stack.

Helper invocation occurs in the POSTROUTING hook, at which point only
the original fragments are available. The result of this is that
fragmented packets are never passed to helpers.

This patch improves the situation in the following way:

- If a reassembled packet belongs to a connection that has a helper
  assigned, the reassembled packet is passed through the stack instead
  of the original fragments.

- During defragmentation, the largest received fragment size is stored.
  On output, the packet is refragmented if required. If the largest
  received fragment size exceeds the outgoing MTU, a "packet too big"
  message is generated, thus behaving as if the original fragments
  were passed through the stack from an outside point of view.

- The ipv6_helper() hook function can't receive fragments anymore for
  connections using a helper, so it is switched to use ipv6_skip_exthdr()
  instead of the netfilter specific nf_ct_ipv6_skip_exthdr() and the
  reassembled packets are passed to connection tracking helpers.

The result of this is that we can properly track fragmented packets, but
still generate ICMPv6 Packet too big messages if we would have before.

This patch is also required as a precondition for IPv6 NAT, where NAT
helpers might enlarge packets up to a point that they require
fragmentation. In that case we can't generate Packet too big messages
since the proper MTU can't be calculated in all cases (f.i. when
changing textual representation of a variable amount of addresses),
so the packet is transparently fragmented iff the original packet or
fragments would have fit the outgoing MTU.

IPVS parts by Jesper Dangaard Brouer <brouer@redhat.com>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2012-08-30 03:00:10 +02:00
..
Kconfig ipvs: ip_vs_ftp depends on nf_conntrack_ftp helper 2012-08-10 10:34:51 +09:00
Makefile IPVS: sip persistence engine 2010-10-04 22:45:24 +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: implement passive PMTUD for IPIP packets 2012-08-10 10:35:03 +09:00
ip_vs_ctl.c Merge git://1984.lsi.us.es/nf-next 2012-08-22 18:48:52 -07:00
ip_vs_dh.c ipvs: DH scheduler does not need GFP_ATOMIC allocation 2012-05-08 19:37:20 +02:00
ip_vs_est.c IPVS: remove unused init and cleanup functions. 2011-06-14 09:07:32 +09:00
ip_vs_ftp.c ipvs: generalize app registration in netns 2012-08-10 10:34:51 +09:00
ip_vs_lblc.c ipvs: LBLC scheduler does not need GFP_ATOMIC allocation on init 2012-05-08 19:37:17 +02:00
ip_vs_lblcr.c ipvs: LBLCR scheduler does not need GFP_ATOMIC allocation on init 2012-05-08 19:37:26 +02: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.c IPVS: Backup, Adding Version 1 receive capability 2010-11-25 10:42:59 +09:00
ip_vs_pe_sip.c net: fix assignment of 0/1 to bool variables. 2011-12-19 22:27:29 -05:00
ip_vs_proto.c ipvs: ip_vs_proto: local functions should not be exposed globally 2012-05-08 19:40:54 +02: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: take care of return value from protocol init_netns 2012-04-30 10:40:35 +02:00
ip_vs_proto_tcp.c ipvs: take care of return value from protocol init_netns 2012-04-30 10:40:35 +02:00
ip_vs_proto_udp.c ipvs: take care of return value from protocol init_netns 2012-04-30 10:40:35 +02: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: make "no destination available" message more informative 2011-02-16 14:53:33 +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: SH scheduler does not need GFP_ATOMIC allocation 2012-05-08 19:37:28 +02: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 netfilter: nf_conntrack_ipv6: improve fragmentation handling 2012-08-30 03:00:10 +02:00