diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-06-10 15:39:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-10 15:39:35 -0400 |
commit | ce4a7d0d48bbaed78ccbb0bafb9229651a40303a (patch) | |
tree | df8770ef69c71a0d6935154add3ff3f4bb8dbc3a /net/dccp/ipv4.c | |
parent | 45d465bc237ab1e1ebb4c65b9b318830dafb7509 (diff) |
inet{6}_request_sock: Init ->opt and ->pktopts in the constructor
Wei Yongjun noticed that we may call reqsk_free on request sock objects where
the opt fields may not be initialized, fix it by introducing inet_reqsk_alloc
where we initialize ->opt to NULL and set ->pktopts to NULL in
inet6_reqsk_alloc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r-- | net/dccp/ipv4.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index c22a3780c14e..37d27bcb361f 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -589,7 +589,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
589 | if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) | 589 | if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) |
590 | goto drop; | 590 | goto drop; |
591 | 591 | ||
592 | req = reqsk_alloc(&dccp_request_sock_ops); | 592 | req = inet_reqsk_alloc(&dccp_request_sock_ops); |
593 | if (req == NULL) | 593 | if (req == NULL) |
594 | goto drop; | 594 | goto drop; |
595 | 595 | ||
@@ -605,7 +605,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
605 | ireq = inet_rsk(req); | 605 | ireq = inet_rsk(req); |
606 | ireq->loc_addr = ip_hdr(skb)->daddr; | 606 | ireq->loc_addr = ip_hdr(skb)->daddr; |
607 | ireq->rmt_addr = ip_hdr(skb)->saddr; | 607 | ireq->rmt_addr = ip_hdr(skb)->saddr; |
608 | ireq->opt = NULL; | ||
609 | 608 | ||
610 | /* | 609 | /* |
611 | * Step 3: Process LISTEN state | 610 | * Step 3: Process LISTEN state |