summaryrefslogtreecommitdiff
path: root/net/ipv6/exthdrs.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2005-11-20 12:23:18 +0900
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2005-11-20 12:23:18 +0900
commitdf9890c31a1a447254f39e40c3fd81ad6547945b (patch)
treebf432d75796112d86d102fe721bdce93e6ad6901 /net/ipv6/exthdrs.c
parenta305989386e402f48b216786a5c8cf440b33bdad (diff)
downloadlinux-3.10-df9890c31a1a447254f39e40c3fd81ad6547945b.tar.gz
linux-3.10-df9890c31a1a447254f39e40c3fd81ad6547945b.tar.bz2
linux-3.10-df9890c31a1a447254f39e40c3fd81ad6547945b.zip
[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/exthdrs.c')
-rw-r--r--net/ipv6/exthdrs.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 748577b76d7..be6faf31138 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -673,3 +673,22 @@ out:
return ERR_PTR(err);
}
+struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
+ struct ipv6_txoptions *opt)
+{
+ /*
+ * ignore the dest before srcrt unless srcrt is being included.
+ * --yoshfuji
+ */
+ if (opt && opt->dst0opt && !opt->srcrt) {
+ if (opt_space != opt) {
+ memcpy(opt_space, opt, sizeof(*opt_space));
+ opt = opt_space;
+ }
+ opt->opt_nflen -= ipv6_optlen(opt->dst0opt);
+ opt->dst0opt = NULL;
+ }
+
+ return opt;
+}
+