diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-06-10 01:13:01 +0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-18 06:30:20 +0200 |
commit | b38dfee3d616ffadb58d4215e3ff9d1d7921031e (patch) | |
tree | 55ae104c8522e973291f490c9902580de798ae93 /include/net | |
parent | [NET] ppp: Remove unnecessary pskb_may_pull (diff) | |
download | linux-b38dfee3d616ffadb58d4215e3ff9d1d7921031e.tar.xz linux-b38dfee3d616ffadb58d4215e3ff9d1d7921031e.zip |
[NET]: skb_trim audit
I found a few more spots where pskb_trim_rcsum could be used but were not.
This patch changes them to use it.
Also, sk_filter can get paged skb data. Therefore we must use pskb_trim
instead of skb_trim.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sock.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 75b0e97ed93d..96565ff0de6a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -873,10 +873,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock) if (filter) { unsigned int pkt_len = sk_run_filter(skb, filter->insns, filter->len); - if (!pkt_len) - err = -EPERM; - else - skb_trim(skb, pkt_len); + err = pkt_len ? pskb_trim(skb, pkt_len) : -EPERM; } if (needlock) |