linux/net/netfilter
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
..
ipset netfilter: ipset: fix crash if IPSET_CMD_NONE command is sent 2012-06-29 13:04:04 +02:00
ipvs netfilter: nf_conntrack_ipv6: improve fragmentation handling 2012-08-30 03:00:10 +02:00
Kconfig netfilter: nfnetlink_queue: fix compilation with NF_CONNTRACK disabled 2012-06-19 04:44:57 +02:00
Makefile netfilter: nfnetlink_queue: fix compilation with NF_CONNTRACK disabled 2012-06-19 04:44:57 +02:00
core.c netfilter: replace list_for_each_continue_rcu with new interface 2012-08-22 19:17:20 +02:00
nf_conntrack_acct.c
nf_conntrack_amanda.c net: Convert net_ratelimit uses to net_<level>_ratelimited 2012-05-15 13:45:03 -04:00
nf_conntrack_broadcast.c
nf_conntrack_core.c netfilter: nf_ct_helper: implement variable length helper private data 2012-06-16 15:08:55 +02:00
nf_conntrack_ecache.c netfilter: nf_ct_ecache: refactor notifier registration 2012-05-08 19:17:23 +02:00
nf_conntrack_expect.c netfilter: nf_ct_expect: fix possible access to uninitialized timer 2012-08-16 11:49:53 +02:00
nf_conntrack_extend.c netfilter: nf_ct_ext: support variable length extensions 2012-06-16 15:08:49 +02:00
nf_conntrack_ftp.c netfilter: nf_ct_helper: implement variable length helper private data 2012-06-16 15:08:55 +02:00
nf_conntrack_h323_asn1.c
nf_conntrack_h323_main.c Merge branch 'master' of git://1984.lsi.us.es/nf-next 2012-06-16 15:23:35 -07:00
nf_conntrack_h323_types.c
nf_conntrack_helper.c netfilter: nf_ct_helper: disable automatic helper re-assignment of different type 2012-06-19 01:24:52 +02:00
nf_conntrack_irc.c netfilter: nf_ct_helper: allocate 16 bytes for the helper and policy names 2012-06-16 15:08:39 +02:00
nf_conntrack_l3proto_generic.c
nf_conntrack_netbios_ns.c
nf_conntrack_netlink.c netfilter: ctnetlink: fix missing locking while changing conntrack from nfqueue 2012-08-14 12:54:45 +02:00
nf_conntrack_pptp.c netfilter: nf_ct_helper: implement variable length helper private data 2012-06-16 15:08:55 +02:00
nf_conntrack_proto.c netfilter: nf_conntrack: remove unnecessary RTNL locking 2012-08-20 12:46:29 +02:00
nf_conntrack_proto_dccp.c netfilter: nf_ct_dccp: add dccp_kmemdup_sysctl_table function 2012-06-27 19:14:31 +02:00
nf_conntrack_proto_generic.c netfilter: nf_conntrack: generalize nf_ct_l4proto_net 2012-07-04 19:37:22 +02:00
nf_conntrack_proto_gre.c netfilter: nf_conntrack: prepare l4proto->init_net cleanup 2012-06-27 18:31:14 +02:00
nf_conntrack_proto_sctp.c netfilter: nf_ct_sctp: merge sctpv[4,6]_net_init into sctp_net_init 2012-06-27 19:13:31 +02:00
nf_conntrack_proto_tcp.c netfilter: nf_ct_tcp: missing per-net support for cttimeout 2012-07-04 19:37:42 +02:00
nf_conntrack_proto_udp.c netfilter: nf_conntrack: generalize nf_ct_l4proto_net 2012-07-04 19:37:22 +02:00
nf_conntrack_proto_udplite.c netfilter: nf_ct_udplite: add udplite_kmemdup_sysctl_table function 2012-06-27 19:12:52 +02:00
nf_conntrack_sane.c netfilter: nf_ct_helper: implement variable length helper private data 2012-06-16 15:08:55 +02:00
nf_conntrack_sip.c netfilter: nf_ct_sip: fix IPv6 address parsing 2012-08-10 11:53:11 +02:00
nf_conntrack_snmp.c
nf_conntrack_standalone.c
nf_conntrack_tftp.c netfilter: nf_ct_helper: allocate 16 bytes for the helper and policy names 2012-06-16 15:08:39 +02:00
nf_conntrack_timeout.c
nf_conntrack_timestamp.c
nf_internals.h
nf_log.c
nf_queue.c
nf_sockopt.c
nf_tproxy_core.c
nfnetlink.c Merge branch 'master' of git://1984.lsi.us.es/nf-next 2012-07-07 16:18:50 -07:00
nfnetlink_acct.c netfilter: sparse endian fixes 2012-08-20 12:45:57 +02:00
nfnetlink_cthelper.c netfilter: sparse endian fixes 2012-08-20 12:45:57 +02:00
nfnetlink_cttimeout.c netfilter: nf_conntrack: add namespace support for cttimeout 2012-06-07 14:58:41 +02:00
nfnetlink_log.c netfilter: nfnetlink_log: Move away from NLMSG_PUT(). 2012-06-26 21:34:03 -07:00
nfnetlink_queue_core.c netfilter: nfnetlink_queue: do not allow to set unsupported flag bits 2012-07-04 19:51:50 +02:00
nfnetlink_queue_ct.c netfilter: nfnetlink_queue: fix sparse warning due to missing include 2012-06-23 02:13:38 +02:00
x_tables.c
xt_AUDIT.c
xt_CHECKSUM.c
xt_CLASSIFY.c
xt_CONNSECMARK.c
xt_CT.c netfilter: nf_ct_helper: implement variable length helper private data 2012-06-16 15:08:55 +02:00
xt_DSCP.c
xt_HL.c
xt_HMARK.c netfilter: xt_HMARK: fix endianness and provide consistent hashing 2012-06-07 14:53:01 +02:00
xt_IDLETIMER.c
xt_LED.c
xt_LOG.c
xt_NFLOG.c
xt_NFQUEUE.c netfilter: sparse endian fixes 2012-08-20 12:45:57 +02:00
xt_NOTRACK.c
xt_RATEEST.c
xt_SECMARK.c
xt_TCPMSS.c net: Convert net_ratelimit uses to net_<level>_ratelimited 2012-05-15 13:45:03 -04:00
xt_TCPOPTSTRIP.c
xt_TEE.c net: replace percpu_xxx funcs with this_cpu_xxx or __this_cpu_xxx 2012-05-14 14:15:31 -07:00
xt_TPROXY.c net: Fix (nearly-)kernel-doc comments for various functions 2012-07-10 23:13:45 -07:00
xt_TRACE.c
xt_addrtype.c
xt_cluster.c
xt_comment.c
xt_connbytes.c
xt_connlimit.c netfilter: xt_connlimit: remove revision 0 2012-06-07 14:58:39 +02:00
xt_connmark.c
xt_conntrack.c
xt_cpu.c
xt_dccp.c
xt_devgroup.c
xt_dscp.c
xt_ecn.c
xt_esp.c
xt_hashlimit.c netfilter: xt_hashlimit: use _ALL macro to reject unknown flag bits 2012-05-17 00:56:31 +02:00
xt_helper.c
xt_hl.c
xt_iprange.c
xt_ipvs.c
xt_length.c
xt_limit.c netfilter: limit, hashlimit: avoid duplicated inline 2012-05-09 12:54:06 +02:00
xt_mac.c netfilter: Convert compare_ether_addr to ether_addr_equal 2012-05-09 20:49:18 -04:00
xt_mark.c
xt_multiport.c
xt_nfacct.c
xt_osf.c netfilter: sparse endian fixes 2012-08-20 12:45:57 +02:00
xt_owner.c
xt_physdev.c
xt_pkttype.c
xt_policy.c
xt_quota.c
xt_rateest.c
xt_realm.c
xt_recent.c netfilter: xt_recent: add address masking option 2012-06-07 14:58:42 +02:00
xt_repldata.h
xt_sctp.c
xt_set.c netfilter: ipset: timeout fixing bug broke SET target special timeout value 2012-07-09 10:53:04 +02:00
xt_socket.c netfilter: ip6_tables: add flags parameter to ipv6_find_hdr() 2012-05-09 12:53:47 +02:00
xt_state.c
xt_statistic.c
xt_string.c
xt_tcpmss.c
xt_tcpudp.c
xt_time.c
xt_u32.c