summaryrefslogtreecommitdiff
path: root/net/core/netpoll.c
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2013-05-28 20:34:29 +0000
committerDavid S. Miller <davem@davemloft.net>2013-05-28 23:49:07 -0700
commit7cc461900549fc480eb133948649a1edb7eaaa6f (patch)
tree32782f0156c0eb27b2b188d7882e9c2e77d7c8c5 /net/core/netpoll.c
parent158874cac61245b84e939c92c53db7000122b7b0 (diff)
downloadlwn-7cc461900549fc480eb133948649a1edb7eaaa6f.tar.gz
lwn-7cc461900549fc480eb133948649a1edb7eaaa6f.zip
net, ipv4, ipv6: Correct assignment of skb->network_header to skb->tail
This corrects an regression introduced by "net: Use 16bits for *_headers fields of struct skbuff" when NET_SKBUFF_DATA_USES_OFFSET is not set. In that case skb->tail will be a pointer however skb->network_header is now an offset. This patch corrects the problem by adding a wrapper to return skb tail as an offset regardless of the value of NET_SKBUFF_DATA_USES_OFFSET. It seems that skb->tail that this offset may be more than 64k and some care has been taken to treat such cases as an error. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r--net/core/netpoll.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 37deedd48bcc..688517c7ff17 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -676,6 +676,8 @@ static void netpoll_neigh_reply(struct sk_buff *skb, struct netpoll_info *npinfo
spin_lock_irqsave(&npinfo->rx_lock, flags);
list_for_each_entry_safe(np, tmp, &npinfo->rx_np, rx) {
+ unsigned long tail_offset;
+
if (!ipv6_addr_equal(daddr, &np->local_ip.in6))
continue;
@@ -700,7 +702,12 @@ static void netpoll_neigh_reply(struct sk_buff *skb, struct netpoll_info *npinfo
hdr->saddr = *saddr;
hdr->daddr = *daddr;
- send_skb->transport_header = send_skb->tail;
+ tail_offset = skb_tail_offset(skb);
+ if (tail_offset > 0xffff) {
+ kfree_skb(send_skb);
+ continue;
+ }
+ skb_set_network_header(send_skb, tail_offset);
skb_put(send_skb, size);
icmp6h = (struct icmp6hdr *)skb_transport_header(skb);