/[linux-patches]/genpatches-2.6/trunk/2.6.19/2000_ipv6-packet-length.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.19/2000_ipv6-packet-length.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 736 - (show annotations) (download) (as text)
Mon Dec 4 16:46:15 2006 UTC (13 years, 8 months ago) by dsd
File MIME type: text/x-diff
File size: 2041 byte(s)
Fix ipv6 crasher
1 From: David S. Miller <davem@sunset.davemloft.net>
2 Date: Sun, 3 Dec 2006 05:00:06 +0000 (-0800)
3 Subject: [IPV6] NDISC: Calculate packet length correctly for allocation.
4 X-Git-Url: http://www2.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=d54a81d341af80875c201890500f727c8188dd9b
5
6 [IPV6] NDISC: Calculate packet length correctly for allocation.
7
8 MAX_HEADER does not include the ipv6 header length in it,
9 so we need to add it in explicitly.
10
11 With help from YOSHIFUJI Hideaki.
12
13 Signed-off-by: David S. Miller <davem@davemloft.net>
14 ---
15
16 --- a/net/ipv6/ndisc.c
17 +++ b/net/ipv6/ndisc.c
18 @@ -472,7 +472,9 @@ static void ndisc_send_na(struct net_dev
19 inc_opt = 0;
20 }
21
22 - skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev),
23 + skb = sock_alloc_send_skb(sk,
24 + (MAX_HEADER + sizeof(struct ipv6hdr) +
25 + len + LL_RESERVED_SPACE(dev)),
26 1, &err);
27
28 if (skb == NULL) {
29 @@ -561,7 +563,9 @@ void ndisc_send_ns(struct net_device *de
30 if (send_llinfo)
31 len += ndisc_opt_addr_space(dev);
32
33 - skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev),
34 + skb = sock_alloc_send_skb(sk,
35 + (MAX_HEADER + sizeof(struct ipv6hdr) +
36 + len + LL_RESERVED_SPACE(dev)),
37 1, &err);
38 if (skb == NULL) {
39 ND_PRINTK0(KERN_ERR
40 @@ -636,7 +640,9 @@ void ndisc_send_rs(struct net_device *de
41 if (dev->addr_len)
42 len += ndisc_opt_addr_space(dev);
43
44 - skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev),
45 + skb = sock_alloc_send_skb(sk,
46 + (MAX_HEADER + sizeof(struct ipv6hdr) +
47 + len + LL_RESERVED_SPACE(dev)),
48 1, &err);
49 if (skb == NULL) {
50 ND_PRINTK0(KERN_ERR
51 @@ -1446,7 +1452,9 @@ void ndisc_send_redirect(struct sk_buff
52 rd_len &= ~0x7;
53 len += rd_len;
54
55 - buff = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev),
56 + buff = sock_alloc_send_skb(sk,
57 + (MAX_HEADER + sizeof(struct ipv6hdr) +
58 + len + LL_RESERVED_SPACE(dev)),
59 1, &err);
60 if (buff == NULL) {
61 ND_PRINTK0(KERN_ERR

  ViewVC Help
Powered by ViewVC 1.1.20