ipv6: raw: fix icmpv6_filter()
authorEric Dumazet <edumazet@google.com>
Tue, 25 Sep 2012 07:03:40 +0000 (07:03 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 10 Oct 2012 02:31:32 +0000 (03:31 +0100)
commitc3fc2c27f7c56d074f740f1735a2760df4a441bd
tree6a94f23234acb9d2a5429294c28f3f454a2383df
parent65a484273f1b97019bcc923be0e47921b895ac30
ipv6: raw: fix icmpv6_filter()

[ Upstream commit 1b05c4b50edbddbdde715c4a7350629819f6655e ]

icmpv6_filter() should not modify its input, or else its caller
would need to recompute ipv6_hdr() if skb->head is reallocated.

Use skb_header_pointer() instead of pskb_may_pull() and
change the prototype to make clear both sk and skb are const.

Also, if icmpv6 header cannot be found, do not deliver the packet,
as we do in IPv4.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/ipv6/raw.c