netfilter: nf_conntrack: make sequence number adjustments usuable without NAT
Split out sequence number adjustments from NAT and move them to the conntrack core to make them usable for SYN proxying. The sequence number adjustment information is moved to a seperate extend. The extend is added to new conntracks when a NAT mapping is set up for a connection using a helper. As a side effect, this saves 24 bytes per connection with NAT in the common case that a connection does not have a helper assigned. Signed-off-by: Patrick McHardy <kaber@trash.net> Tested-by: Martin Topholm <mph@one.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:

committed by
Pablo Neira Ayuso

parent
706f5151e3
commit
41d73ec053
@@ -99,7 +99,8 @@ enum ip_conntrack_events {
|
||||
IPCT_PROTOINFO, /* protocol information has changed */
|
||||
IPCT_HELPER, /* new helper has been set */
|
||||
IPCT_MARK, /* new mark has been set */
|
||||
IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */
|
||||
IPCT_SEQADJ, /* sequence adjustment has changed */
|
||||
IPCT_NATSEQADJ = IPCT_SEQADJ,
|
||||
IPCT_SECMARK, /* new security mark has been set */
|
||||
IPCT_LABEL, /* new connlabel has been set */
|
||||
};
|
||||
|
@@ -42,8 +42,10 @@ enum ctattr_type {
|
||||
CTA_ID,
|
||||
CTA_NAT_DST,
|
||||
CTA_TUPLE_MASTER,
|
||||
CTA_NAT_SEQ_ADJ_ORIG,
|
||||
CTA_NAT_SEQ_ADJ_REPLY,
|
||||
CTA_SEQ_ADJ_ORIG,
|
||||
CTA_NAT_SEQ_ADJ_ORIG = CTA_SEQ_ADJ_ORIG,
|
||||
CTA_SEQ_ADJ_REPLY,
|
||||
CTA_NAT_SEQ_ADJ_REPLY = CTA_SEQ_ADJ_REPLY,
|
||||
CTA_SECMARK, /* obsolete */
|
||||
CTA_ZONE,
|
||||
CTA_SECCTX,
|
||||
@@ -165,6 +167,15 @@ enum ctattr_protonat {
|
||||
};
|
||||
#define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1)
|
||||
|
||||
enum ctattr_seqadj {
|
||||
CTA_SEQADJ_UNSPEC,
|
||||
CTA_SEQADJ_CORRECTION_POS,
|
||||
CTA_SEQADJ_OFFSET_BEFORE,
|
||||
CTA_SEQADJ_OFFSET_AFTER,
|
||||
__CTA_SEQADJ_MAX
|
||||
};
|
||||
#define CTA_SEQADJ_MAX (__CTA_SEQADJ_MAX - 1)
|
||||
|
||||
enum ctattr_natseq {
|
||||
CTA_NAT_SEQ_UNSPEC,
|
||||
CTA_NAT_SEQ_CORRECTION_POS,
|
||||
|
Reference in New Issue
Block a user