summaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-12-08 11:10:47 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-12-08 11:10:47 +0100
commita516e5f8e550a6073aae96491372c45ce340da88 (patch)
treee87a074749efdad9365a83678d74f076a6a95171 /src/parse.c
parent1c7352133af433d3d3881bb21e1de0e9e32f5b8c (diff)
downloadconntrack-tools-a516e5f8e550a6073aae96491372c45ce340da88.tar.gz
conntrack-tools-a516e5f8e550a6073aae96491372c45ce340da88.zip
network: remove the netpld header from the messages
This patch simplifies the message format of the replication messages. As a result, we save four bytes. The netpld header was introduced in the early protocol design. Today, it does not have any reason to exist. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/parse.c b/src/parse.c
index 4eb74b2..17a0107 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -150,30 +150,16 @@ parse_nat_seq_adj(struct nf_conntrack *ct, int attr, void *data)
ntohl(this->orig_seq_correction_pos));
}
-int
-parse_netpld(struct nf_conntrack *ct,
- struct nethdr *net,
- int *query,
- size_t remain)
+int parse_payload(struct nf_conntrack *ct, struct nethdr *net, size_t remain)
{
int len;
struct netattr *attr;
- struct netpld *pld;
- if (remain < NETHDR_SIZ + sizeof(struct netpld))
+ if (remain < net->len)
return -1;
- pld = NETHDR_DATA(net);
-
- if (remain < NETHDR_SIZ + sizeof(struct netpld) + ntohs(pld->len))
- return -1;
-
- if (net->len < NETHDR_SIZ + sizeof(struct netpld) + ntohs(pld->len))
- return -1;
-
- PLD_NETWORK2HOST(pld);
- len = pld->len;
- attr = PLD_DATA(pld);
+ len = net->len - NETHDR_SIZ;
+ attr = NETHDR_DATA(net);
while (len > ssizeof(struct netattr)) {
ATTR_NETWORK2HOST(attr);
@@ -187,6 +173,5 @@ parse_netpld(struct nf_conntrack *ct,
attr = NTA_NEXT(attr, len);
}
- *query = pld->query;
return 0;
}