Skip to content

Commit

Permalink
netfilter: nf_ct_sip: handle non-linear skbs
Browse files Browse the repository at this point in the history
Handle non-linear skbs by linearizing them instead of silently failing.
Long term the helper should be fixed to either work with non-linear skbs
directly by using the string search API or work on a copy of the data.

Based on patch by Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Patrick McHardy committed May 14, 2010
1 parent 736d58e commit a1d7c1b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions net/netfilter/nf_conntrack_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,10 +1393,8 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,

nf_ct_refresh(ct, skb, sip_timeout * HZ);

if (skb_is_nonlinear(skb)) {
pr_debug("Copy of skbuff not supported yet.\n");
return NF_ACCEPT;
}
if (unlikely(skb_linearize(skb)))
return NF_DROP;

dptr = skb->data + dataoff;
datalen = skb->len - dataoff;
Expand Down Expand Up @@ -1455,10 +1453,8 @@ static int sip_help_udp(struct sk_buff *skb, unsigned int protoff,

nf_ct_refresh(ct, skb, sip_timeout * HZ);

if (skb_is_nonlinear(skb)) {
pr_debug("Copy of skbuff not supported yet.\n");
return NF_ACCEPT;
}
if (unlikely(skb_linearize(skb)))
return NF_DROP;

dptr = skb->data + dataoff;
datalen = skb->len - dataoff;
Expand Down

0 comments on commit a1d7c1b

Please sign in to comment.