diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-03-20 22:21:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 22:21:44 -0500 |
commit | 91f0ebf7b6d5cb2b6e818d48587566144821babe (patch) | |
tree | 505c66f36bd72014d7eacb7a04ea011bae2e9a3a /net/dccp/minisocks.c | |
parent | f38c39d6ce8226519455a6dfe91c2ad84f363f6f (diff) |
[DCCP] CCID: Improve CCID infrastructure
1. No need for ->ccid_init nor ->ccid_exit, this is what module_{init,exit}
does and anynways neither ccid2 nor ccid3 were using it.
2. Rename struct ccid to struct ccid_operations and introduce struct ccid
with a pointer to ccid_operations and rigth after it the rx or tx
private state.
3. Remove the pointer to the state of the half connections from struct
dccp_sock, now its derived thru ccid_priv() from the ccid pointer.
Now we also can implement the setsockopt for changing the CCID easily as
no ccid init routines can affect struct dccp_sock in any way that prevents
other CCIDs from working if a CCID switch operation is asked by apps.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/minisocks.c')
-rw-r--r-- | net/dccp/minisocks.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c index 9e1de5919ee5..5324fcacb34d 100644 --- a/net/dccp/minisocks.c +++ b/net/dccp/minisocks.c | |||
@@ -121,23 +121,21 @@ struct sock *dccp_create_openreq_child(struct sock *sk, | |||
121 | if (newdp->dccps_options.dccpo_send_ack_vector) { | 121 | if (newdp->dccps_options.dccpo_send_ack_vector) { |
122 | newdp->dccps_hc_rx_ackvec = | 122 | newdp->dccps_hc_rx_ackvec = |
123 | dccp_ackvec_alloc(GFP_ATOMIC); | 123 | dccp_ackvec_alloc(GFP_ATOMIC); |
124 | /* | ||
125 | * XXX: We're using the same CCIDs set on the parent, | ||
126 | * i.e. sk_clone copied the master sock and left the | ||
127 | * CCID pointers for this child, that is why we do the | ||
128 | * __ccid_get calls. | ||
129 | */ | ||
130 | if (unlikely(newdp->dccps_hc_rx_ackvec == NULL)) | 124 | if (unlikely(newdp->dccps_hc_rx_ackvec == NULL)) |
131 | goto out_free; | 125 | goto out_free; |
132 | } | 126 | } |
133 | 127 | ||
134 | if (unlikely(ccid_hc_rx_init(newdp->dccps_hc_rx_ccid, | 128 | newdp->dccps_hc_rx_ccid = |
135 | newsk) != 0 || | 129 | ccid_hc_rx_new(newdp->dccps_options.dccpo_rx_ccid, |
136 | ccid_hc_tx_init(newdp->dccps_hc_tx_ccid, | 130 | newsk, GFP_ATOMIC); |
137 | newsk) != 0)) { | 131 | newdp->dccps_hc_tx_ccid = |
132 | ccid_hc_tx_new(newdp->dccps_options.dccpo_tx_ccid, | ||
133 | newsk, GFP_ATOMIC); | ||
134 | if (unlikely(newdp->dccps_hc_rx_ccid == NULL || | ||
135 | newdp->dccps_hc_tx_ccid == NULL)) { | ||
138 | dccp_ackvec_free(newdp->dccps_hc_rx_ackvec); | 136 | dccp_ackvec_free(newdp->dccps_hc_rx_ackvec); |
139 | ccid_hc_rx_exit(newdp->dccps_hc_rx_ccid, newsk); | 137 | ccid_hc_rx_delete(newdp->dccps_hc_rx_ccid, newsk); |
140 | ccid_hc_tx_exit(newdp->dccps_hc_tx_ccid, newsk); | 138 | ccid_hc_tx_delete(newdp->dccps_hc_tx_ccid, newsk); |
141 | out_free: | 139 | out_free: |
142 | /* It is still raw copy of parent, so invalidate | 140 | /* It is still raw copy of parent, so invalidate |
143 | * destructor and make plain sk_free() */ | 141 | * destructor and make plain sk_free() */ |
@@ -146,9 +144,6 @@ out_free: | |||
146 | return NULL; | 144 | return NULL; |
147 | } | 145 | } |
148 | 146 | ||
149 | __ccid_get(newdp->dccps_hc_rx_ccid); | ||
150 | __ccid_get(newdp->dccps_hc_tx_ccid); | ||
151 | |||
152 | /* | 147 | /* |
153 | * Step 3: Process LISTEN state | 148 | * Step 3: Process LISTEN state |
154 | * | 149 | * |