aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-06-25 00:22:08 +0100
committerBen Hutchings <bhutchings@solarflare.com>2011-06-25 00:43:50 +0100
commit589327905cf0ce4402f7fb1ed29682f7ae68a82e (patch)
tree8395e43faa28ed863c1fe270ced3111ee66d3d3c /drivers/net/sfc
parenta659b2a94d87add999229ecd9f2f56817d5d737b (diff)
sfc: Fix assertions in efx_filter_rfs()
This function is intended to assert (when DEBUG is defined) that the skb header area includes the header fields it's looking at, which RFS should already have pulled. But it uses pskb_may_pull(), which will attempt to pull more data if necesary. It must instead compare skb_headlen() with the required length. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/filter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/sfc/filter.c b/drivers/net/sfc/filter.c
index 054f0a3d45a..2b9636f96e0 100644
--- a/drivers/net/sfc/filter.c
+++ b/drivers/net/sfc/filter.c
@@ -657,11 +657,11 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
return -EPROTONOSUPPORT;
/* RFS must validate the IP header length before calling us */
- EFX_BUG_ON_PARANOID(!pskb_may_pull(skb, nhoff + sizeof(*ip)));
+ EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + sizeof(*ip));
ip = (const struct iphdr *)(skb->data + nhoff);
if (ip_is_fragment(ip))
return -EPROTONOSUPPORT;
- EFX_BUG_ON_PARANOID(!pskb_may_pull(skb, nhoff + 4 * ip->ihl + 4));
+ EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + 4 * ip->ihl + 4);
ports = (const __be16 *)(skb->data + nhoff + 4 * ip->ihl);
efx_filter_init_rx(&spec, EFX_FILTER_PRI_HINT, 0, rxq_index);