diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index c8666b7..3782c17 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2540,11 +2540,10 @@ static int do_tcp_getsockopt(struct sock *sk, int level, ctd.tcpct_cookie_desired = cvp->cookie_desired; ctd.tcpct_s_data_desired = cvp->s_data_desired; - /* Cookie(s) saved, return as nonce */ - if (sizeof(ctd.tcpct_value) < cvp->cookie_pair_size) { - /* impossible? */ - return -EINVAL; - } + /* Cookie(s) saved, return as nonce. + * Assumes TCP_MSS_DEFAULT > TCP_COOKIE_PAIR_SIZE, + * sizeof(ctd.tcpct_value) > cvp->cookie_pair_size + */ memcpy(&ctd.tcpct_value[0], &cvp->cookie_pair[0], cvp->cookie_pair_size); ctd.tcpct_used = cvp->cookie_pair_size; -- 1.6.3.3