]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ctnetlink: add callbacks to the per-proto nlattrs
authorHolger Eitzenberger <holger@eitzenberger.org>
Wed, 25 Mar 2009 17:24:48 +0000 (18:24 +0100)
committerPatrick McHardy <kaber@trash.net>
Wed, 25 Mar 2009 17:24:48 +0000 (18:24 +0100)
commitd883f413ab874b08353afe5bee799a65e3e6d382
treedb731388062d6b81e73bc9328fdd29e6eb81c509
parentae036b4f502b80fa2308447a7f968cfe5b3a03b6
netfilter: ctnetlink: add callbacks to the per-proto nlattrs

There is added a single callback for the l3 proto helper.  The two
callbacks for the l4 protos are necessary because of the general
structure of a ctnetlink event, which is in short:

 CTA_TUPLE_ORIG
   <l3/l4-proto-attributes>
 CTA_TUPLE_REPLY
   <l3/l4-proto-attributes>
 CTA_ID
 ...
 CTA_PROTOINFO
   <l4-proto-attributes>
 CTA_TUPLE_MASTER
   <l3/l4-proto-attributes>

Therefore the formular is

 size := sizeof(generic-nlas) + 3 * sizeof(tuple_nlas) + sizeof(protoinfo_nlas)

Some of the NLAs are optional, e. g. CTA_TUPLE_MASTER, which is only
set if it's an expected connection.  But the number of optional NLAs is
small enough to prevent netlink_trim() from reallocating if calculated
properly.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
include/net/netfilter/nf_conntrack_l3proto.h
include/net/netfilter/nf_conntrack_l4proto.h
net/netfilter/nf_conntrack_proto.c