diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-11-19 22:23:18 -0500 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-11-19 22:23:18 -0500 |
commit | df9890c31a1a447254f39e40c3fd81ad6547945b (patch) | |
tree | bf432d75796112d86d102fe721bdce93e6ad6901 /net/ipv6/ip6_flowlabel.c | |
parent | a305989386e402f48b216786a5c8cf440b33bdad (diff) |
[IPV6]: Fix sending extension headers before and including routing header.
Based on suggestion from Masahide Nakamura <nakam@linux-ipv6.org>.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/ip6_flowlabel.c')
-rw-r--r-- | net/ipv6/ip6_flowlabel.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index bbbe80cdaf72..1cf02765fb5c 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
@@ -225,20 +225,16 @@ struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space, | |||
225 | struct ip6_flowlabel * fl, | 225 | struct ip6_flowlabel * fl, |
226 | struct ipv6_txoptions * fopt) | 226 | struct ipv6_txoptions * fopt) |
227 | { | 227 | { |
228 | struct ipv6_txoptions * fl_opt = fl ? fl->opt : NULL; | 228 | struct ipv6_txoptions * fl_opt = fl->opt; |
229 | 229 | ||
230 | if (fopt == NULL || fopt->opt_flen == 0) { | 230 | if (fopt == NULL || fopt->opt_flen == 0) |
231 | if (!fl_opt || !fl_opt->dst0opt || fl_opt->srcrt) | 231 | return fl_opt; |
232 | return fl_opt; | 232 | |
233 | } | ||
234 | |||
235 | if (fl_opt != NULL) { | 233 | if (fl_opt != NULL) { |
236 | opt_space->hopopt = fl_opt->hopopt; | 234 | opt_space->hopopt = fl_opt->hopopt; |
237 | opt_space->dst0opt = fl_opt->srcrt ? fl_opt->dst0opt : NULL; | 235 | opt_space->dst0opt = fl_opt->dst0opt; |
238 | opt_space->srcrt = fl_opt->srcrt; | 236 | opt_space->srcrt = fl_opt->srcrt; |
239 | opt_space->opt_nflen = fl_opt->opt_nflen; | 237 | opt_space->opt_nflen = fl_opt->opt_nflen; |
240 | if (fl_opt->dst0opt && !fl_opt->srcrt) | ||
241 | opt_space->opt_nflen -= ipv6_optlen(fl_opt->dst0opt); | ||
242 | } else { | 238 | } else { |
243 | if (fopt->opt_nflen == 0) | 239 | if (fopt->opt_nflen == 0) |
244 | return fopt; | 240 | return fopt; |