LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [rfc 02/13] [RFC 02/13] netfilter: nf_conntrack_sip: Add callid pars

To: Simon Horman <horms@xxxxxxxxxxxx>
Subject: Re: [rfc 02/13] [RFC 02/13] netfilter: nf_conntrack_sip: Add callid parser
Cc: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Wensong Zhang <wensong@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>
From: Patrick McHardy <kaber@xxxxxxxxx>
Date: Fri, 06 Aug 2010 16:00:49 +0200
Am 05.08.2010 13:47, schrieb Simon Horman:
> diff --git a/net/netfilter/nf_conntrack_sip.c 
> b/net/netfilter/nf_conntrack_sip.c
> index 2fd1ea2..715ce54 100644
> --- a/net/netfilter/nf_conntrack_sip.c
> +++ b/net/netfilter/nf_conntrack_sip.c
> @@ -130,6 +130,44 @@ static int digits_len(const struct nf_conn *ct, const 
> char *dptr,
>       return len;
>  }
>  
> +static int iswordc(const char c)
> +{
> +     if (isalnum(c) || c == '!' || c == '"' || c == '%' ||
> +         (c >= '(' && c <= '/') || c == ':' || c == '<' || c == '>' ||
> +         c == '?' || (c >= '[' && c <= ']') || c == '_' || c == '`' ||
> +         c == '{' || c == '}' || c == '~')
> +             return 1;
> +     return 0;
> +}
> +
> +static int word_len(const char *dptr, const char *limit)
> +{
> +     int len = 0;
> +     while (dptr < limit && iswordc(*dptr)) {
> +             dptr++;
> +             len++;
> +     }
> +     return len;
> +}

Since the Call-ID can't contain whitespace, couldn't we simply
determine the length by looking for the next newline or whitespace
character?
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>