/[linux-patches]/genpatches-2.6/tags/2.6.14-5/1020_3_ipv6-extension-headers.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.14-5/1020_3_ipv6-extension-headers.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 226 - (show annotations) (download)
Fri Dec 2 12:14:55 2005 UTC (12 years, 7 months ago) by dsd
File size: 3582 byte(s)
2.6.14-5 release
1 From stable-bounces@linux.kernel.org Mon Nov 21 02:07:06 2005
2 Date: Mon, 21 Nov 2005 19:07:40 +0900 (JST)
3 Message-Id: <20051121.190740.64964243.yoshfuji@linux-ipv6.org>
4 To: stable@kernel.org
5 From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
6 Cc: yoshfuji@linux-ipv6.org
7 Subject: [PATCH] [IPV6]: Fix sending extension headers before and including routing header.
8
9 Based on suggestion from Masahide Nakamura <nakam@linux-ipv6.org>.
10
11 Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
12 Signed-off-by: Chris Wright <chrisw@osdl.org>
13 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 ---
15 include/net/ipv6.h | 2 ++
16 net/ipv6/exthdrs.c | 19 +++++++++++++++++++
17 net/ipv6/ip6_flowlabel.c | 16 ++++++----------
18 net/ipv6/raw.c | 4 +++-
19 net/ipv6/udp.c | 4 +++-
20 5 files changed, 33 insertions(+), 12 deletions(-)
21
22 --- linux-2.6.14.2.orig/include/net/ipv6.h
23 +++ linux-2.6.14.2/include/net/ipv6.h
24 @@ -237,6 +237,8 @@ extern struct ipv6_txoptions * ipv6_rene
25 int newtype,
26 struct ipv6_opt_hdr __user *newopt,
27 int newoptlen);
28 +struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
29 + struct ipv6_txoptions *opt);
30
31 extern int ip6_frag_nqueues;
32 extern atomic_t ip6_frag_mem;
33 --- linux-2.6.14.2.orig/net/ipv6/exthdrs.c
34 +++ linux-2.6.14.2/net/ipv6/exthdrs.c
35 @@ -673,3 +673,22 @@ out:
36 return ERR_PTR(err);
37 }
38
39 +struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
40 + struct ipv6_txoptions *opt)
41 +{
42 + /*
43 + * ignore the dest before srcrt unless srcrt is being included.
44 + * --yoshfuji
45 + */
46 + if (opt && opt->dst0opt && !opt->srcrt) {
47 + if (opt_space != opt) {
48 + memcpy(opt_space, opt, sizeof(*opt_space));
49 + opt = opt_space;
50 + }
51 + opt->opt_nflen -= ipv6_optlen(opt->dst0opt);
52 + opt->dst0opt = NULL;
53 + }
54 +
55 + return opt;
56 +}
57 +
58 --- linux-2.6.14.2.orig/net/ipv6/ip6_flowlabel.c
59 +++ linux-2.6.14.2/net/ipv6/ip6_flowlabel.c
60 @@ -225,20 +225,16 @@ struct ipv6_txoptions *fl6_merge_options
61 struct ip6_flowlabel * fl,
62 struct ipv6_txoptions * fopt)
63 {
64 - struct ipv6_txoptions * fl_opt = fl ? fl->opt : NULL;
65 -
66 - if (fopt == NULL || fopt->opt_flen == 0) {
67 - if (!fl_opt || !fl_opt->dst0opt || fl_opt->srcrt)
68 - return fl_opt;
69 - }
70 -
71 + struct ipv6_txoptions * fl_opt = fl->opt;
72 +
73 + if (fopt == NULL || fopt->opt_flen == 0)
74 + return fl_opt;
75 +
76 if (fl_opt != NULL) {
77 opt_space->hopopt = fl_opt->hopopt;
78 - opt_space->dst0opt = fl_opt->srcrt ? fl_opt->dst0opt : NULL;
79 + opt_space->dst0opt = fl_opt->dst0opt;
80 opt_space->srcrt = fl_opt->srcrt;
81 opt_space->opt_nflen = fl_opt->opt_nflen;
82 - if (fl_opt->dst0opt && !fl_opt->srcrt)
83 - opt_space->opt_nflen -= ipv6_optlen(fl_opt->dst0opt);
84 } else {
85 if (fopt->opt_nflen == 0)
86 return fopt;
87 --- linux-2.6.14.2.orig/net/ipv6/raw.c
88 +++ linux-2.6.14.2/net/ipv6/raw.c
89 @@ -756,7 +756,9 @@ static int rawv6_sendmsg(struct kiocb *i
90 }
91 if (opt == NULL)
92 opt = np->opt;
93 - opt = fl6_merge_options(&opt_space, flowlabel, opt);
94 + if (flowlabel)
95 + opt = fl6_merge_options(&opt_space, flowlabel, opt);
96 + opt = ipv6_fixup_options(&opt_space, opt);
97
98 fl.proto = proto;
99 rawv6_probe_proto_opt(&fl, msg);
100 --- linux-2.6.14.2.orig/net/ipv6/udp.c
101 +++ linux-2.6.14.2/net/ipv6/udp.c
102 @@ -778,7 +778,9 @@ do_udp_sendmsg:
103 }
104 if (opt == NULL)
105 opt = np->opt;
106 - opt = fl6_merge_options(&opt_space, flowlabel, opt);
107 + if (flowlabel)
108 + opt = fl6_merge_options(&opt_space, flowlabel, opt);
109 + opt = ipv6_fixup_options(&opt_space, opt);
110
111 fl->proto = IPPROTO_UDP;
112 ipv6_addr_copy(&fl->fl6_dst, daddr);

  ViewVC Help
Powered by ViewVC 1.1.20