aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-08-09 22:49:02 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:37:48 -0400
commit6cbb0df788b90777a7ed0f9d8261260353f48076 (patch)
tree152b75c0279b8f612412f24a5ab35ab6d5a208d8 /net/ipv4/tcp_ipv4.c
parent614c6cb4f225a7da9f13e5dd0fac3b531078eb9f (diff)
[SOCK]: Introduce sk_setup_caps
From tcp_v4_setup_caps, that always is preceded by a call to __sk_dst_set, so coalesce this sequence into sk_setup_caps, removing one call to a TCP function in the IP layer. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index c7c99d336368..4a5daecbd2ac 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -837,8 +837,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
837 goto failure; 837 goto failure;
838 838
839 /* OK, now commit destination to socket. */ 839 /* OK, now commit destination to socket. */
840 __sk_dst_set(sk, &rt->u.dst); 840 sk_setup_caps(sk, &rt->u.dst);
841 tcp_v4_setup_caps(sk, &rt->u.dst);
842 841
843 if (!tp->write_seq) 842 if (!tp->write_seq)
844 tp->write_seq = secure_tcp_sequence_number(inet->saddr, 843 tp->write_seq = secure_tcp_sequence_number(inet->saddr,
@@ -1553,8 +1552,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1553 if (!newsk) 1552 if (!newsk)
1554 goto exit; 1553 goto exit;
1555 1554
1556 newsk->sk_dst_cache = dst; 1555 sk_setup_caps(newsk, dst);
1557 tcp_v4_setup_caps(newsk, dst);
1558 1556
1559 newtp = tcp_sk(newsk); 1557 newtp = tcp_sk(newsk);
1560 newinet = inet_sk(newsk); 1558 newinet = inet_sk(newsk);
@@ -1855,8 +1853,7 @@ static int tcp_v4_reselect_saddr(struct sock *sk)
1855 if (err) 1853 if (err)
1856 return err; 1854 return err;
1857 1855
1858 __sk_dst_set(sk, &rt->u.dst); 1856 sk_setup_caps(sk, &rt->u.dst);
1859 tcp_v4_setup_caps(sk, &rt->u.dst);
1860 1857
1861 new_saddr = rt->rt_src; 1858 new_saddr = rt->rt_src;
1862 1859
@@ -1914,8 +1911,7 @@ int tcp_v4_rebuild_header(struct sock *sk)
1914 err = ip_route_output_flow(&rt, &fl, sk, 0); 1911 err = ip_route_output_flow(&rt, &fl, sk, 0);
1915 } 1912 }
1916 if (!err) { 1913 if (!err) {
1917 __sk_dst_set(sk, &rt->u.dst); 1914 sk_setup_caps(sk, &rt->u.dst);
1918 tcp_v4_setup_caps(sk, &rt->u.dst);
1919 return 0; 1915 return 0;
1920 } 1916 }
1921 1917