summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-08-02 22:22:46 -0700
committerDavid S. Miller <davem@davemloft.net>2010-08-02 22:22:46 -0700
commit00dad5e479531e379aba7358600cc768725d4f1f (patch)
tree652199eacee32c2cf317f5a54da8265973d29978 /net/ipv4
parentc477d0447db08068a497e7beb892b2b2a7bff64b (diff)
parent3a3dfb062c2e086c202d34f09ce29634515ad256 (diff)
downloadlinux-3.10-00dad5e479531e379aba7358600cc768725d4f1f.tar.gz
linux-3.10-00dad5e479531e379aba7358600cc768725d4f1f.tar.bz2
linux-3.10-00dad5e479531e379aba7358600cc768725d4f1f.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/e1000e/hw.h net/bridge/br_device.c net/bridge/br_input.c
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 1a700651600..176e11aaea7 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2187,6 +2187,8 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
GFP_KERNEL);
if (cvp == NULL)
return -ENOMEM;
+
+ kref_init(&cvp->kref);
}
lock_sock(sk);
tp->rx_opt.cookie_in_always =
@@ -2201,12 +2203,11 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
*/
kref_put(&tp->cookie_values->kref,
tcp_cookie_values_release);
- kref_init(&cvp->kref);
- tp->cookie_values = cvp;
} else {
cvp = tp->cookie_values;
}
}
+
if (cvp != NULL) {
cvp->cookie_desired = ctd.tcpct_cookie_desired;
@@ -2220,6 +2221,8 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
cvp->s_data_desired = ctd.tcpct_s_data_desired;
cvp->s_data_constant = 0; /* false */
}
+
+ tp->cookie_values = cvp;
}
release_sock(sk);
return err;