diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2006-11-10 09:32:01 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:21:58 -0500 |
commit | 8a73cd09d96aa01743316657fc4e6864fe79b703 (patch) | |
tree | fa22ed8ac78c5c76cc8ee3afd8bf72607290d42d /net/dccp/ipv4.c | |
parent | f6484f7c7ad22e4bb018875c386d6a7aaa441426 (diff) |
[DCCP]: calling dccp_v{4,6}_reqsk_send_ack is a BUG
This patch removes two functions, the send_ack functions of request_sock,
which are not called/used by the DCCP code. It is correct that these
functions are not called, below is a justification why calling these
functions (on a passive socket in the LISTEN/RESPOND state) would mean
a DCCP protocol violation.
A) Background: using request_sock in TCP:
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r-- | net/dccp/ipv4.c | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 7107885ada7e..8dd9f5aa27a2 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -193,52 +193,6 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk, | |||
193 | } /* else let the usual retransmit timer handle it */ | 193 | } /* else let the usual retransmit timer handle it */ |
194 | } | 194 | } |
195 | 195 | ||
196 | static void dccp_v4_reqsk_send_ack(struct sk_buff *rxskb, | ||
197 | struct request_sock *req) | ||
198 | { | ||
199 | int err; | ||
200 | struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh; | ||
201 | const u32 dccp_hdr_ack_len = sizeof(struct dccp_hdr) + | ||
202 | sizeof(struct dccp_hdr_ext) + | ||
203 | sizeof(struct dccp_hdr_ack_bits); | ||
204 | struct sk_buff *skb; | ||
205 | |||
206 | if (((struct rtable *)rxskb->dst)->rt_type != RTN_LOCAL) | ||
207 | return; | ||
208 | |||
209 | skb = alloc_skb(dccp_v4_ctl_socket->sk->sk_prot->max_header, GFP_ATOMIC); | ||
210 | if (skb == NULL) | ||
211 | return; | ||
212 | |||
213 | /* Reserve space for headers. */ | ||
214 | skb_reserve(skb, dccp_v4_ctl_socket->sk->sk_prot->max_header); | ||
215 | skb->dst = dst_clone(rxskb->dst); | ||
216 | |||
217 | dh = dccp_zeroed_hdr(skb, dccp_hdr_ack_len); | ||
218 | |||
219 | /* Build DCCP header and checksum it. */ | ||
220 | dh->dccph_type = DCCP_PKT_ACK; | ||
221 | dh->dccph_sport = rxdh->dccph_dport; | ||
222 | dh->dccph_dport = rxdh->dccph_sport; | ||
223 | dh->dccph_doff = dccp_hdr_ack_len / 4; | ||
224 | dh->dccph_x = 1; | ||
225 | |||
226 | dccp_hdr_set_seq(dh, DCCP_SKB_CB(rxskb)->dccpd_ack_seq); | ||
227 | dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), | ||
228 | DCCP_SKB_CB(rxskb)->dccpd_seq); | ||
229 | |||
230 | bh_lock_sock(dccp_v4_ctl_socket->sk); | ||
231 | err = ip_build_and_send_pkt(skb, dccp_v4_ctl_socket->sk, | ||
232 | rxskb->nh.iph->daddr, | ||
233 | rxskb->nh.iph->saddr, NULL); | ||
234 | bh_unlock_sock(dccp_v4_ctl_socket->sk); | ||
235 | |||
236 | if (err == NET_XMIT_CN || err == 0) { | ||
237 | DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS); | ||
238 | DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS); | ||
239 | } | ||
240 | } | ||
241 | |||
242 | static int dccp_v4_send_response(struct sock *sk, struct request_sock *req, | 196 | static int dccp_v4_send_response(struct sock *sk, struct request_sock *req, |
243 | struct dst_entry *dst) | 197 | struct dst_entry *dst) |
244 | { | 198 | { |
@@ -1014,7 +968,7 @@ static struct request_sock_ops dccp_request_sock_ops __read_mostly = { | |||
1014 | .family = PF_INET, | 968 | .family = PF_INET, |
1015 | .obj_size = sizeof(struct dccp_request_sock), | 969 | .obj_size = sizeof(struct dccp_request_sock), |
1016 | .rtx_syn_ack = dccp_v4_send_response, | 970 | .rtx_syn_ack = dccp_v4_send_response, |
1017 | .send_ack = dccp_v4_reqsk_send_ack, | 971 | .send_ack = dccp_reqsk_send_ack, |
1018 | .destructor = dccp_v4_reqsk_destructor, | 972 | .destructor = dccp_v4_reqsk_destructor, |
1019 | .send_reset = dccp_v4_ctl_send_reset, | 973 | .send_reset = dccp_v4_ctl_send_reset, |
1020 | }; | 974 | }; |