summaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2006-11-10 16:08:37 -0200
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:22:03 -0800
commitcf557926f6955b4c3fa55e81fdb3675e752e8eed (patch)
tree672d24def170058545736be30040ef2249741cc3 /net/dccp/ipv4.c
parentf45b3ec481581f24719d8ab0bc812c02fcedc2bc (diff)
downloadlinux-cf557926f6955b4c3fa55e81fdb3675e752e8eed.tar.bz2
[DCCP]: tidy up dccp_v{4,6}_conn_request
This is a code simplification to remove reduplicated code by concentrating and abstracting shared code. Detailed Changes:
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r--net/dccp/ipv4.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index ed6202652bcc..d75ce8c7e488 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -636,11 +636,8 @@ static struct request_sock_ops dccp_request_sock_ops __read_mostly = {
int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
{
struct inet_request_sock *ireq;
- struct dccp_sock dp;
struct request_sock *req;
struct dccp_request_sock *dreq;
- const __be32 saddr = skb->nh.iph->saddr;
- const __be32 daddr = skb->nh.iph->daddr;
const __be32 service = dccp_hdr_request(skb)->dccph_req_service;
struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb);
__u8 reset_code = DCCP_RESET_CODE_TOO_BUSY;
@@ -680,14 +677,14 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
if (dccp_parse_options(sk, skb))
goto drop_and_free;
- dccp_openreq_init(req, &dp, skb);
+ dccp_reqsk_init(req, skb);
if (security_inet_conn_request(sk, skb, req))
goto drop_and_free;
ireq = inet_rsk(req);
- ireq->loc_addr = daddr;
- ireq->rmt_addr = saddr;
+ ireq->loc_addr = skb->nh.iph->daddr;
+ ireq->rmt_addr = skb->nh.iph->saddr;
req->rcv_wnd = dccp_feat_default_sequence_window;
ireq->opt = NULL;