aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/output.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-12-14 02:26:10 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 16:10:58 -0500
commitd83d8461f902c672bc1bd8fbc6a94e19f092da97 (patch)
tree0534c553ab92baa2eb9dbb5bba64f2c4540b1e89 /net/dccp/output.c
parent22712813620fa8e682dbfb253a60ca0131da1e07 (diff)
[IP_SOCKGLUE]: Remove most of the tcp specific calls
As DCCP needs to be called in the same spots. Now we have a member in inet_sock (is_icsk), set at sock creation time from struct inet_protosw->flags (if INET_PROTOSW_ICSK is set, like for TCP and DCCP) to see if a struct sock instance is a inet_connection_sock for places like the ones in ip_sockglue.c (v4 and v6) where we previously were looking if sk_type was SOCK_STREAM, that is insufficient because we now use the same code for DCCP, that has sk_type SOCK_DCCP. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/output.c')
-rw-r--r--net/dccp/output.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c
index c40f7f8a328b..95a3c2c6a3ce 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -134,12 +134,13 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
134 134
135unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu) 135unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
136{ 136{
137 struct inet_connection_sock *icsk = inet_csk(sk);
137 struct dccp_sock *dp = dccp_sk(sk); 138 struct dccp_sock *dp = dccp_sk(sk);
138 int mss_now = (pmtu - inet_csk(sk)->icsk_af_ops->net_header_len - 139 int mss_now = (pmtu - icsk->icsk_af_ops->net_header_len -
139 sizeof(struct dccp_hdr) - sizeof(struct dccp_hdr_ext)); 140 sizeof(struct dccp_hdr) - sizeof(struct dccp_hdr_ext));
140 141
141 /* Now subtract optional transport overhead */ 142 /* Now subtract optional transport overhead */
142 mss_now -= dp->dccps_ext_header_len; 143 mss_now -= icsk->icsk_ext_hdr_len;
143 144
144 /* 145 /*
145 * FIXME: this should come from the CCID infrastructure, where, say, 146 * FIXME: this should come from the CCID infrastructure, where, say,
@@ -152,7 +153,7 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
152 mss_now -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4; 153 mss_now -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4;
153 154
154 /* And store cached results */ 155 /* And store cached results */
155 dp->dccps_pmtu_cookie = pmtu; 156 icsk->icsk_pmtu_cookie = pmtu;
156 dp->dccps_mss_cache = mss_now; 157 dp->dccps_mss_cache = mss_now;
157 158
158 return mss_now; 159 return mss_now;