aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2012-06-04 00:35:19 -0400
committerLen Brown <len.brown@intel.com>2012-06-04 00:35:19 -0400
commit7e1bd6e38b1f30860ce25a014c6d6adfb0079f4a (patch)
tree65c5898ba93007d4399150c7a127a670bcfbc30d /net/ipv6/tcp_ipv6.c
parent301f33fbcf4ced53b3de114846ecece5d6aafeeb (diff)
parentf8f5701bdaf9134b1f90e5044a82c66324d2073f (diff)
Merge branch 'upstream' into bugfix-video
Update bugfix-video branch to 2.5-rc1 so I don't have to again resolve the conflict in these patches vs. upstream. Conflicts: drivers/gpu/drm/gma500/psb_drv.c text conflict: add comment vs delete neighboring line keep just this: /* igd_opregion_init(&dev_priv->opregion_dev); */ /* acpi_video_register(); */ Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c84
1 files changed, 19 insertions, 65 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 98256cf72f9d..3a9aec29581a 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -476,7 +476,8 @@ out:
476 476
477 477
478static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req, 478static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
479 struct request_values *rvp) 479 struct request_values *rvp,
480 u16 queue_mapping)
480{ 481{
481 struct inet6_request_sock *treq = inet6_rsk(req); 482 struct inet6_request_sock *treq = inet6_rsk(req);
482 struct ipv6_pinfo *np = inet6_sk(sk); 483 struct ipv6_pinfo *np = inet6_sk(sk);
@@ -513,6 +514,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
513 __tcp_v6_send_check(skb, &treq->loc_addr, &treq->rmt_addr); 514 __tcp_v6_send_check(skb, &treq->loc_addr, &treq->rmt_addr);
514 515
515 fl6.daddr = treq->rmt_addr; 516 fl6.daddr = treq->rmt_addr;
517 skb_set_queue_mapping(skb, queue_mapping);
516 err = ip6_xmit(sk, skb, &fl6, opt, np->tclass); 518 err = ip6_xmit(sk, skb, &fl6, opt, np->tclass);
517 err = net_xmit_eval(err); 519 err = net_xmit_eval(err);
518 } 520 }
@@ -528,7 +530,7 @@ static int tcp_v6_rtx_synack(struct sock *sk, struct request_sock *req,
528 struct request_values *rvp) 530 struct request_values *rvp)
529{ 531{
530 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_RETRANSSEGS); 532 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_RETRANSSEGS);
531 return tcp_v6_send_synack(sk, req, rvp); 533 return tcp_v6_send_synack(sk, req, rvp, 0);
532} 534}
533 535
534static void tcp_v6_reqsk_destructor(struct request_sock *req) 536static void tcp_v6_reqsk_destructor(struct request_sock *req)
@@ -723,12 +725,10 @@ static int tcp_v6_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb)
723 NULL, NULL, skb); 725 NULL, NULL, skb);
724 726
725 if (genhash || memcmp(hash_location, newhash, 16) != 0) { 727 if (genhash || memcmp(hash_location, newhash, 16) != 0) {
726 if (net_ratelimit()) { 728 net_info_ratelimited("MD5 Hash %s for [%pI6c]:%u->[%pI6c]:%u\n",
727 printk(KERN_INFO "MD5 Hash %s for [%pI6c]:%u->[%pI6c]:%u\n", 729 genhash ? "failed" : "mismatch",
728 genhash ? "failed" : "mismatch", 730 &ip6h->saddr, ntohs(th->source),
729 &ip6h->saddr, ntohs(th->source), 731 &ip6h->daddr, ntohs(th->dest));
730 &ip6h->daddr, ntohs(th->dest));
731 }
732 return 1; 732 return 1;
733 } 733 }
734 return 0; 734 return 0;
@@ -1057,7 +1057,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
1057 struct tcp_sock *tp = tcp_sk(sk); 1057 struct tcp_sock *tp = tcp_sk(sk);
1058 __u32 isn = TCP_SKB_CB(skb)->when; 1058 __u32 isn = TCP_SKB_CB(skb)->when;
1059 struct dst_entry *dst = NULL; 1059 struct dst_entry *dst = NULL;
1060 int want_cookie = 0; 1060 bool want_cookie = false;
1061 1061
1062 if (skb->protocol == htons(ETH_P_IP)) 1062 if (skb->protocol == htons(ETH_P_IP))
1063 return tcp_v4_conn_request(sk, skb); 1063 return tcp_v4_conn_request(sk, skb);
@@ -1118,7 +1118,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
1118 while (l-- > 0) 1118 while (l-- > 0)
1119 *c++ ^= *hash_location++; 1119 *c++ ^= *hash_location++;
1120 1120
1121 want_cookie = 0; /* not our kind of cookie */ 1121 want_cookie = false; /* not our kind of cookie */
1122 tmp_ext.cookie_out_never = 0; /* false */ 1122 tmp_ext.cookie_out_never = 0; /* false */
1123 tmp_ext.cookie_plus = tmp_opt.cookie_plus; 1123 tmp_ext.cookie_plus = tmp_opt.cookie_plus;
1124 } else if (!tp->rx_opt.cookie_in_always) { 1124 } else if (!tp->rx_opt.cookie_in_always) {
@@ -1140,7 +1140,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
1140 treq->rmt_addr = ipv6_hdr(skb)->saddr; 1140 treq->rmt_addr = ipv6_hdr(skb)->saddr;
1141 treq->loc_addr = ipv6_hdr(skb)->daddr; 1141 treq->loc_addr = ipv6_hdr(skb)->daddr;
1142 if (!want_cookie || tmp_opt.tstamp_ok) 1142 if (!want_cookie || tmp_opt.tstamp_ok)
1143 TCP_ECN_create_request(req, tcp_hdr(skb)); 1143 TCP_ECN_create_request(req, skb);
1144 1144
1145 treq->iif = sk->sk_bound_dev_if; 1145 treq->iif = sk->sk_bound_dev_if;
1146 1146
@@ -1215,7 +1215,8 @@ have_isn:
1215 security_inet_conn_request(sk, skb, req); 1215 security_inet_conn_request(sk, skb, req);
1216 1216
1217 if (tcp_v6_send_synack(sk, req, 1217 if (tcp_v6_send_synack(sk, req,
1218 (struct request_values *)&tmp_ext) || 1218 (struct request_values *)&tmp_ext,
1219 skb_get_queue_mapping(skb)) ||
1219 want_cookie) 1220 want_cookie)
1220 goto drop_and_free; 1221 goto drop_and_free;
1221 1222
@@ -1353,7 +1354,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1353 newnp->pktoptions = NULL; 1354 newnp->pktoptions = NULL;
1354 if (treq->pktopts != NULL) { 1355 if (treq->pktopts != NULL) {
1355 newnp->pktoptions = skb_clone(treq->pktopts, GFP_ATOMIC); 1356 newnp->pktoptions = skb_clone(treq->pktopts, GFP_ATOMIC);
1356 kfree_skb(treq->pktopts); 1357 consume_skb(treq->pktopts);
1357 treq->pktopts = NULL; 1358 treq->pktopts = NULL;
1358 if (newnp->pktoptions) 1359 if (newnp->pktoptions)
1359 skb_set_owner_r(newnp->pktoptions, newsk); 1360 skb_set_owner_r(newnp->pktoptions, newsk);
@@ -1658,7 +1659,8 @@ process:
1658 if (!tcp_prequeue(sk, skb)) 1659 if (!tcp_prequeue(sk, skb))
1659 ret = tcp_v6_do_rcv(sk, skb); 1660 ret = tcp_v6_do_rcv(sk, skb);
1660 } 1661 }
1661 } else if (unlikely(sk_add_backlog(sk, skb))) { 1662 } else if (unlikely(sk_add_backlog(sk, skb,
1663 sk->sk_rcvbuf + sk->sk_sndbuf))) {
1662 bh_unlock_sock(sk); 1664 bh_unlock_sock(sk);
1663 NET_INC_STATS_BH(net, LINUX_MIB_TCPBACKLOGDROP); 1665 NET_INC_STATS_BH(net, LINUX_MIB_TCPBACKLOGDROP);
1664 goto discard_and_relse; 1666 goto discard_and_relse;
@@ -1777,6 +1779,7 @@ static const struct inet_connection_sock_af_ops ipv6_specific = {
1777 .syn_recv_sock = tcp_v6_syn_recv_sock, 1779 .syn_recv_sock = tcp_v6_syn_recv_sock,
1778 .get_peer = tcp_v6_get_peer, 1780 .get_peer = tcp_v6_get_peer,
1779 .net_header_len = sizeof(struct ipv6hdr), 1781 .net_header_len = sizeof(struct ipv6hdr),
1782 .net_frag_header_len = sizeof(struct frag_hdr),
1780 .setsockopt = ipv6_setsockopt, 1783 .setsockopt = ipv6_setsockopt,
1781 .getsockopt = ipv6_getsockopt, 1784 .getsockopt = ipv6_getsockopt,
1782 .addr2sockaddr = inet6_csk_addr2sockaddr, 1785 .addr2sockaddr = inet6_csk_addr2sockaddr,
@@ -1833,64 +1836,15 @@ static const struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific = {
1833static int tcp_v6_init_sock(struct sock *sk) 1836static int tcp_v6_init_sock(struct sock *sk)
1834{ 1837{
1835 struct inet_connection_sock *icsk = inet_csk(sk); 1838 struct inet_connection_sock *icsk = inet_csk(sk);
1836 struct tcp_sock *tp = tcp_sk(sk);
1837
1838 skb_queue_head_init(&tp->out_of_order_queue);
1839 tcp_init_xmit_timers(sk);
1840 tcp_prequeue_init(tp);
1841
1842 icsk->icsk_rto = TCP_TIMEOUT_INIT;
1843 tp->mdev = TCP_TIMEOUT_INIT;
1844 1839
1845 /* So many TCP implementations out there (incorrectly) count the 1840 tcp_init_sock(sk);
1846 * initial SYN frame in their delayed-ACK and congestion control
1847 * algorithms that we must have the following bandaid to talk
1848 * efficiently to them. -DaveM
1849 */
1850 tp->snd_cwnd = 2;
1851
1852 /* See draft-stevens-tcpca-spec-01 for discussion of the
1853 * initialization of these values.
1854 */
1855 tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
1856 tp->snd_cwnd_clamp = ~0;
1857 tp->mss_cache = TCP_MSS_DEFAULT;
1858
1859 tp->reordering = sysctl_tcp_reordering;
1860
1861 sk->sk_state = TCP_CLOSE;
1862 1841
1863 icsk->icsk_af_ops = &ipv6_specific; 1842 icsk->icsk_af_ops = &ipv6_specific;
1864 icsk->icsk_ca_ops = &tcp_init_congestion_ops;
1865 icsk->icsk_sync_mss = tcp_sync_mss;
1866 sk->sk_write_space = sk_stream_write_space;
1867 sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
1868 1843
1869#ifdef CONFIG_TCP_MD5SIG 1844#ifdef CONFIG_TCP_MD5SIG
1870 tp->af_specific = &tcp_sock_ipv6_specific; 1845 tcp_sk(sk)->af_specific = &tcp_sock_ipv6_specific;
1871#endif 1846#endif
1872 1847
1873 /* TCP Cookie Transactions */
1874 if (sysctl_tcp_cookie_size > 0) {
1875 /* Default, cookies without s_data_payload. */
1876 tp->cookie_values =
1877 kzalloc(sizeof(*tp->cookie_values),
1878 sk->sk_allocation);
1879 if (tp->cookie_values != NULL)
1880 kref_init(&tp->cookie_values->kref);
1881 }
1882 /* Presumed zeroed, in order of appearance:
1883 * cookie_in_always, cookie_out_never,
1884 * s_data_constant, s_data_in, s_data_out
1885 */
1886 sk->sk_sndbuf = sysctl_tcp_wmem[1];
1887 sk->sk_rcvbuf = sysctl_tcp_rmem[1];
1888
1889 local_bh_disable();
1890 sock_update_memcg(sk);
1891 sk_sockets_allocated_inc(sk);
1892 local_bh_enable();
1893
1894 return 0; 1848 return 0;
1895} 1849}
1896 1850