* [PATCH 7/11]: Integrate feature-negotiation insertion code
@ 2007-10-01 14:18 Gerrit Renker
2007-10-01 23:06 ` Ian McDonald
0 siblings, 1 reply; 2+ messages in thread
From: Gerrit Renker @ 2007-10-01 14:18 UTC (permalink / raw)
To: dccp
[DCCP]: Integrate feature-negotiation insertion code
The patch implements insertion of feature negotiation at the server (listening and
request socket) and the client (connecting socket).
In dccp_insert_options(), several statements have been grouped together now to achieve
(I hope) better efficiency by reducing the number of tests each packet has to go through:
- Ack Vectors are, as before, sent if the packet is neither a Data or a Request packet;
- a previous issue is corrected - feature negotiation options are allowed on DataAck
packets (5.8).
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
net/dccp/options.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -528,11 +528,23 @@ int dccp_insert_options(struct sock *sk,
dccp_insert_option_ndp(sk, skb))
return -1;
- if (!dccp_packet_without_ack(skb)) {
- if (dmsk->dccpms_send_ack_vector &&
- dccp_ackvec_pending(dp->dccps_hc_rx_ackvec) &&
- dccp_insert_option_ackvec(sk, skb))
+ if (DCCP_SKB_CB(skb)->dccpd_type != DCCP_PKT_DATA) {
+
+ /* Feature Negotiation */
+ if (dccp_feat_insert_opts(dp, NULL, skb))
return -1;
+
+ if (DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_REQUEST) {
+ /*
+ * Obtain RTT sample from Request/Response exchange.
+ * This is currently used in CCID 3 initialisation.
+ */
+ if (dccp_insert_option_timestamp(sk, skb))
+ return -1;
+ } else if (dmsk->dccpms_send_ack_vector &&
+ dccp_ackvec_pending(dp->dccps_hc_rx_ackvec) &&
+ dccp_insert_option_ackvec(sk, skb))
+ return -1;
}
if (dp->dccps_hc_rx_insert_options) {
@@ -541,21 +553,6 @@ int dccp_insert_options(struct sock *sk,
dp->dccps_hc_rx_insert_options = 0;
}
- /* Feature negotiation */
- /* Data packets can't do feat negotiation */
- if (DCCP_SKB_CB(skb)->dccpd_type != DCCP_PKT_DATA &&
- DCCP_SKB_CB(skb)->dccpd_type != DCCP_PKT_DATAACK &&
- dccp_insert_options_feat(sk, skb))
- return -1;
-
- /*
- * Obtain RTT sample from Request/Response exchange.
- * This is currently used in CCID 3 initialisation.
- */
- if (DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_REQUEST &&
- dccp_insert_option_timestamp(sk, skb))
- return -1;
-
if (dp->dccps_tstamp != NULL &&
dccp_insert_option_timestamp_echo(&dp->dccps_tstamp, skb))
return -1;
@@ -572,6 +569,9 @@ int dccp_insert_options_rsk(struct dccp_
{
DCCP_SKB_CB(skb)->dccpd_opt_len = 0;
+ if (dccp_feat_insert_opts(NULL, dreq, skb))
+ return -1;
+
if (dreq->dreq_tstamp != NULL &&
dccp_insert_option_timestamp_echo(&dreq->dreq_tstamp, skb))
return -1;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 7/11]: Integrate feature-negotiation insertion code
2007-10-01 14:18 [PATCH 7/11]: Integrate feature-negotiation insertion code Gerrit Renker
@ 2007-10-01 23:06 ` Ian McDonald
0 siblings, 0 replies; 2+ messages in thread
From: Ian McDonald @ 2007-10-01 23:06 UTC (permalink / raw)
To: dccp
On 10/2/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> [DCCP]: Integrate feature-negotiation insertion code
>
> The patch implements insertion of feature negotiation at the server (listening and
> request socket) and the client (connecting socket).
>
> In dccp_insert_options(), several statements have been grouped together now to achieve
> (I hope) better efficiency by reducing the number of tests each packet has to go through:
> - Ack Vectors are, as before, sent if the packet is neither a Data or a Request packet;
> - a previous issue is corrected - feature negotiation options are allowed on DataAck
> packets (5.8).
>
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-01 23:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-01 14:18 [PATCH 7/11]: Integrate feature-negotiation insertion code Gerrit Renker
2007-10-01 23:06 ` Ian McDonald
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.