Skip to content

Commit

Permalink
netfilter: nf_conntrack_sip: de-static helper pointers
Browse files Browse the repository at this point in the history
Helper's ->help hook can run concurrently with itself, so iterating over
SIP helpers with static pointer won't work reliably.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexey Dobriyan authored and David S. Miller committed Sep 8, 2008
1 parent fca1287 commit 66bf791
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/netfilter/nf_conntrack_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,6 @@ static const struct sip_handler sip_handlers[] = {
static int process_sip_response(struct sk_buff *skb,
const char **dptr, unsigned int *datalen)
{
static const struct sip_handler *handler;
enum ip_conntrack_info ctinfo;
struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
unsigned int matchoff, matchlen;
Expand All @@ -1214,6 +1213,8 @@ static int process_sip_response(struct sk_buff *skb,
dataoff = matchoff + matchlen + 1;

for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) {
const struct sip_handler *handler;

handler = &sip_handlers[i];
if (handler->response == NULL)
continue;
Expand All @@ -1228,13 +1229,14 @@ static int process_sip_response(struct sk_buff *skb,
static int process_sip_request(struct sk_buff *skb,
const char **dptr, unsigned int *datalen)
{
static const struct sip_handler *handler;
enum ip_conntrack_info ctinfo;
struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
unsigned int matchoff, matchlen;
unsigned int cseq, i;

for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) {
const struct sip_handler *handler;

handler = &sip_handlers[i];
if (handler->request == NULL)
continue;
Expand Down

0 comments on commit 66bf791

Please sign in to comment.