diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2016-08-03 06:41:40 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-08 05:58:43 -0400 |
commit | 0d35d0815b19216f852f257afe420f7c7d182780 (patch) | |
tree | 99bffa0fa77acfd0a8215617897350a233f7f3a8 | |
parent | c1eda3c6394f805886b2afa8c7ea5e04305ec698 (diff) |
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: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/nf_conntrack_sip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index 8d9db9d4702b..7d77217de6a3 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c | |||
@@ -1383,7 +1383,7 @@ static int process_sip_response(struct sk_buff *skb, unsigned int protoff, | |||
1383 | return NF_DROP; | 1383 | return NF_DROP; |
1384 | } | 1384 | } |
1385 | cseq = simple_strtoul(*dptr + matchoff, NULL, 10); | 1385 | cseq = simple_strtoul(*dptr + matchoff, NULL, 10); |
1386 | if (!cseq) { | 1386 | if (!cseq && *(*dptr + matchoff) != '0') { |
1387 | nf_ct_helper_log(skb, ct, "cannot get cseq"); | 1387 | nf_ct_helper_log(skb, ct, "cannot get cseq"); |
1388 | return NF_DROP; | 1388 | return NF_DROP; |
1389 | } | 1389 | } |
@@ -1446,7 +1446,7 @@ static int process_sip_request(struct sk_buff *skb, unsigned int protoff, | |||
1446 | return NF_DROP; | 1446 | return NF_DROP; |
1447 | } | 1447 | } |
1448 | cseq = simple_strtoul(*dptr + matchoff, NULL, 10); | 1448 | cseq = simple_strtoul(*dptr + matchoff, NULL, 10); |
1449 | if (!cseq) { | 1449 | if (!cseq && *(*dptr + matchoff) != '0') { |
1450 | nf_ct_helper_log(skb, ct, "cannot get cseq"); | 1450 | nf_ct_helper_log(skb, ct, "cannot get cseq"); |
1451 | return NF_DROP; | 1451 | return NF_DROP; |
1452 | } | 1452 | } |