summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-12-08 11:07:58 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-12-08 11:07:58 +0100
commit6042436a188581a327580f7821c0a3b94c4ef5d7 (patch)
tree33b85488a2973399b7d8f878736fa1e869317918
parent8663becfe12801a4b5a96137a0db26a8871948a3 (diff)
downloadconntrack-tools-6042436a188581a327580f7821c0a3b94c4ef5d7.tar.gz
conntrack-tools-6042436a188581a327580f7821c0a3b94c4ef5d7.zip
parse: fix missing master layer 4 protocol number assignation
This patch fixes NTA_MASTER_L4PROTO parsing which was missing. This problem was introduced in "network: rework TLV-based protocol", commit id 76ac8ebe5e49385585c8e29fe530ed4baef390bf, ie. somewhere in the development of 0.9.9. This patch also fixes the size of parsing callback array that is NTA_MAX, not ATTR_MAX. This problem does not affect conntrack-tools <= 0.9.8. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--include/network.h1
-rw-r--r--src/parse.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/include/network.h b/include/network.h
index 6ab099f..3f8123d 100644
--- a/include/network.h
+++ b/include/network.h
@@ -196,6 +196,7 @@ enum nta_attr {
NTA_SPAT_PORT, /* uint16_t */
NTA_DPAT_PORT, /* uint16_t */
NTA_NAT_SEQ_ADJ = 16, /* struct nta_attr_natseqadj */
+ NTA_MAX
};
struct nta_attr_natseqadj {
diff --git a/src/parse.c b/src/parse.c
index 0184c5a..4eb74b2 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -35,7 +35,7 @@ struct parser {
int attr;
};
-static struct parser h[ATTR_MAX] = {
+static struct parser h[NTA_MAX] = {
[NTA_IPV4] = {
.parse = parse_group,
.attr = ATTR_GRP_ORIG_IPV4,
@@ -76,6 +76,10 @@ static struct parser h[ATTR_MAX] = {
.parse = parse_group,
.attr = ATTR_GRP_MASTER_IPV6,
},
+ [NTA_MASTER_L4PROTO] = {
+ .parse = parse_u8,
+ .attr = ATTR_MASTER_L4PROTO,
+ },
[NTA_MASTER_PORT] = {
.parse = parse_group,
.attr = ATTR_GRP_MASTER_PORT,