diff options
author | Eric Dumazet <edumazet@google.com> | 2012-09-25 02:21:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-25 03:11:13 -0400 |
commit | 8489c1d9a80e6263fb71de5bc7f39773712cfa7e (patch) | |
tree | e580f2a356bcd6a0b5a64a7ab1e98e1fd7e7b39b /net/ipv4 | |
parent | 82c93fcc2e1737fede2752520f1bf8f4de6304d8 (diff) |
net: raw: revert unrelated change
Commit 5640f7685831 ("net: use a per task frag allocator")
accidentally contained an unrelated change to net/ipv4/raw.c,
later committed (without the pr_err() debugging bits) in
net tree as commit ab43ed8b749 (ipv4: raw: fix icmp_filter())
This patch reverts this glitch, noticed by Stephen Rothwell.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/raw.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index a80740ba4248..f2425785d40a 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -131,23 +131,18 @@ found: | |||
131 | * 0 - deliver | 131 | * 0 - deliver |
132 | * 1 - block | 132 | * 1 - block |
133 | */ | 133 | */ |
134 | static int icmp_filter(const struct sock *sk, const struct sk_buff *skb) | 134 | static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb) |
135 | { | 135 | { |
136 | struct icmphdr _hdr; | 136 | int type; |
137 | const struct icmphdr *hdr; | 137 | |
138 | 138 | if (!pskb_may_pull(skb, sizeof(struct icmphdr))) | |
139 | pr_err("icmp_filter skb_transport_offset %d data-head %ld len %d/%d\n", | ||
140 | skb_transport_offset(skb), skb->data - skb->head, skb->len, skb->data_len); | ||
141 | hdr = skb_header_pointer(skb, skb_transport_offset(skb), | ||
142 | sizeof(_hdr), &_hdr); | ||
143 | pr_err("head %p data %p hdr %p type %d\n", skb->head, skb->data, hdr, hdr ? hdr->type : -1); | ||
144 | if (!hdr) | ||
145 | return 1; | 139 | return 1; |
146 | 140 | ||
147 | if (hdr->type < 32) { | 141 | type = icmp_hdr(skb)->type; |
142 | if (type < 32) { | ||
148 | __u32 data = raw_sk(sk)->filter.data; | 143 | __u32 data = raw_sk(sk)->filter.data; |
149 | 144 | ||
150 | return ((1U << hdr->type) & data) != 0; | 145 | return ((1 << type) & data) != 0; |
151 | } | 146 | } |
152 | 147 | ||
153 | /* Do not block unknown ICMP types */ | 148 | /* Do not block unknown ICMP types */ |