diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2005-11-20 23:52:16 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-11-20 23:52:16 -0500 |
commit | 1ef43204f4bd24dcd3156185b19b31b6b4151ae9 (patch) | |
tree | 812293eda94f9e14ee35c0be3d84da4b96f4972e /net/ipv6/exthdrs.c | |
parent | 5d5780df23537ad0db72267fe11103d2c23d9b2a (diff) | |
parent | df9890c31a1a447254f39e40c3fd81ad6547945b (diff) |
Merge git://git.skbuff.net/gitroot/yoshfuji/linux-2.6.14+advapi-fix/
Diffstat (limited to 'net/ipv6/exthdrs.c')
-rw-r--r-- | net/ipv6/exthdrs.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 922549581abc..be6faf311387 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
@@ -628,6 +628,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, | |||
628 | if (!tot_len) | 628 | if (!tot_len) |
629 | return NULL; | 629 | return NULL; |
630 | 630 | ||
631 | tot_len += sizeof(*opt2); | ||
631 | opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC); | 632 | opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC); |
632 | if (!opt2) | 633 | if (!opt2) |
633 | return ERR_PTR(-ENOBUFS); | 634 | return ERR_PTR(-ENOBUFS); |
@@ -668,7 +669,26 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, | |||
668 | 669 | ||
669 | return opt2; | 670 | return opt2; |
670 | out: | 671 | out: |
671 | sock_kfree_s(sk, p, tot_len); | 672 | sock_kfree_s(sk, opt2, opt2->tot_len); |
672 | return ERR_PTR(err); | 673 | return ERR_PTR(err); |
673 | } | 674 | } |
674 | 675 | ||
676 | struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, | ||
677 | struct ipv6_txoptions *opt) | ||
678 | { | ||
679 | /* | ||
680 | * ignore the dest before srcrt unless srcrt is being included. | ||
681 | * --yoshfuji | ||
682 | */ | ||
683 | if (opt && opt->dst0opt && !opt->srcrt) { | ||
684 | if (opt_space != opt) { | ||
685 | memcpy(opt_space, opt, sizeof(*opt_space)); | ||
686 | opt = opt_space; | ||
687 | } | ||
688 | opt->opt_nflen -= ipv6_optlen(opt->dst0opt); | ||
689 | opt->dst0opt = NULL; | ||
690 | } | ||
691 | |||
692 | return opt; | ||
693 | } | ||
694 | |||