diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-06-09 19:13:01 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-18 00:30:20 -0400 |
commit | b38dfee3d616ffadb58d4215e3ff9d1d7921031e (patch) | |
tree | 55ae104c8522e973291f490c9902580de798ae93 /include/net | |
parent | c8c9f9a3de2c50c876b1068dd41f9a06c5749f80 (diff) |
[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) | |||
873 | if (filter) { | 873 | if (filter) { |
874 | unsigned int pkt_len = sk_run_filter(skb, filter->insns, | 874 | unsigned int pkt_len = sk_run_filter(skb, filter->insns, |
875 | filter->len); | 875 | filter->len); |
876 | if (!pkt_len) | 876 | err = pkt_len ? pskb_trim(skb, pkt_len) : -EPERM; |
877 | err = -EPERM; | ||
878 | else | ||
879 | skb_trim(skb, pkt_len); | ||
880 | } | 877 | } |
881 | 878 | ||
882 | if (needlock) | 879 | if (needlock) |