ct_sip_parse_numerical_param can only return 0 or 1, but the caller is
checking parsing error using < 0

Signed-off-by: Tong Zhang <ztong0...@gmail.com>
---
 net/netfilter/nf_conntrack_sip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index b83dc9bf0a5d..08873694120a 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -1269,7 +1269,7 @@ static int process_register_request(struct sk_buff *skb, 
unsigned int protoff,
 
        if (ct_sip_parse_numerical_param(ct, *dptr,
                                         matchoff + matchlen, *datalen,
-                                        "expires=", NULL, NULL, &expires) < 0) 
{
+                                        "expires=", NULL, NULL, &expires) == 
0) {
                nf_ct_helper_log(skb, ct, "cannot parse expires");
                return NF_DROP;
        }
@@ -1375,7 +1375,7 @@ static int process_register_response(struct sk_buff *skb, 
unsigned int protoff,
                                                   matchoff + matchlen,
                                                   *datalen, "expires=",
                                                   NULL, NULL, &c_expires);
-               if (ret < 0) {
+               if (ret == 0) {
                        nf_ct_helper_log(skb, ct, "cannot parse expires");
                        return NF_DROP;
                }
-- 
2.25.1

Reply via email to