diff options
author | Patrick McHardy <kaber@trash.net> | 2008-03-25 20:17:36 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-25 20:17:36 -0700 |
commit | 779382eb324ad0c39f8c4d10a47a813b490ab82c (patch) | |
tree | 8bf8bb8b4588baab54ffe8f07e06e1dfe21cf9e1 /net/netfilter/nf_conntrack_sip.c | |
parent | 212440a7d04a12ee13787afecc6c86c7fc4e6184 (diff) | |
download | op-kernel-dev-779382eb324ad0c39f8c4d10a47a813b490ab82c.zip op-kernel-dev-779382eb324ad0c39f8c4d10a47a813b490ab82c.tar.gz |
[NETFILTER]: nf_conntrack_sip: use strlen/strcmp
Replace sizeof/memcmp by strlen/strcmp. Use case-insensitive comparison
for SIP methods and the SIP/2.0 string, as specified in RFC 3261.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/nf_conntrack_sip.c')
-rw-r--r-- | net/netfilter/nf_conntrack_sip.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index 38e1e7a..cf19a70 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c @@ -434,15 +434,15 @@ static int sip_help(struct sk_buff *skb, } datalen = skb->len - dataoff; - if (datalen < sizeof("SIP/2.0 200") - 1) + if (datalen < strlen("SIP/2.0 200")) goto out; /* RTP info only in some SDP pkts */ - if (memcmp(dptr, "INVITE", sizeof("INVITE") - 1) != 0 && - memcmp(dptr, "UPDATE", sizeof("UPDATE") - 1) != 0 && - memcmp(dptr, "SIP/2.0 180", sizeof("SIP/2.0 180") - 1) != 0 && - memcmp(dptr, "SIP/2.0 183", sizeof("SIP/2.0 183") - 1) != 0 && - memcmp(dptr, "SIP/2.0 200", sizeof("SIP/2.0 200") - 1) != 0) { + if (strnicmp(dptr, "INVITE", strlen("INVITE")) != 0 && + strnicmp(dptr, "UPDATE", strlen("UPDATE")) != 0 && + strnicmp(dptr, "SIP/2.0 180", strlen("SIP/2.0 180")) != 0 && + strnicmp(dptr, "SIP/2.0 183", strlen("SIP/2.0 183")) != 0 && + strnicmp(dptr, "SIP/2.0 200", strlen("SIP/2.0 200")) != 0) { goto out; } /* Get address and port from SDP packet. */ |