Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=286930797d74b2c9a5beae84836044f6a836235f
Commit:     286930797d74b2c9a5beae84836044f6a836235f
Parent:     d644329bc9f10213a282387dfe4984ff891dd768
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 12:50:46 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Mar 7 16:08:05 2007 -0800

    [IPV6]: Handle np->opt being NULL in ipv6_getsockopt_sticky().
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv6/ipv6_sockglue.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 286c867..4e0561a 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -795,11 +795,15 @@ int compat_ipv6_setsockopt(struct sock *sk, int level, 
int optname,
 EXPORT_SYMBOL(compat_ipv6_setsockopt);
 #endif
 
-static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr,
+static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
                                  char __user *optval, int len)
 {
-       if (!hdr)
+       struct ipv6_opt_hdr *hdr;
+
+       if (!opt || !opt->hopopt)
                return 0;
+       hdr = opt->hopopt;
+
        len = min_t(int, len, ipv6_optlen(hdr));
        if (copy_to_user(optval, hdr, ipv6_optlen(hdr)))
                return -EFAULT;
@@ -940,7 +944,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, 
int optname,
        {
 
                lock_sock(sk);
-               len = ipv6_getsockopt_sticky(sk, np->opt->hopopt,
+               len = ipv6_getsockopt_sticky(sk, np->opt,
                                             optval, len);
                release_sock(sk);
                return put_user(len, optlen);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to