提交 0d35d081 编写于 作者: C Christophe Leroy 提交者: Pablo Neira Ayuso

netfilter: nf_conntrack_sip: CSeq 0 is a valid CSeq

Do not drop packet when CSeq is 0 as 0 is also a valid value for CSeq.

simple_strtoul() will return 0 either when all digits are 0
or if there are no digits at all. Therefore when simple_strtoul()
returns 0 we check if first character is digit 0 or not.
Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 c1eda3c6
...@@ -1383,7 +1383,7 @@ static int process_sip_response(struct sk_buff *skb, unsigned int protoff, ...@@ -1383,7 +1383,7 @@ static int process_sip_response(struct sk_buff *skb, unsigned int protoff,
return NF_DROP; return NF_DROP;
} }
cseq = simple_strtoul(*dptr + matchoff, NULL, 10); cseq = simple_strtoul(*dptr + matchoff, NULL, 10);
if (!cseq) { if (!cseq && *(*dptr + matchoff) != '0') {
nf_ct_helper_log(skb, ct, "cannot get cseq"); nf_ct_helper_log(skb, ct, "cannot get cseq");
return NF_DROP; return NF_DROP;
} }
...@@ -1446,7 +1446,7 @@ static int process_sip_request(struct sk_buff *skb, unsigned int protoff, ...@@ -1446,7 +1446,7 @@ static int process_sip_request(struct sk_buff *skb, unsigned int protoff,
return NF_DROP; return NF_DROP;
} }
cseq = simple_strtoul(*dptr + matchoff, NULL, 10); cseq = simple_strtoul(*dptr + matchoff, NULL, 10);
if (!cseq) { if (!cseq && *(*dptr + matchoff) != '0') {
nf_ct_helper_log(skb, ct, "cannot get cseq"); nf_ct_helper_log(skb, ct, "cannot get cseq");
return NF_DROP; return NF_DROP;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册