Skip to contentSkip to conversation

: Insert feature-negotiation options into skb

PATCH In review Gerrit Renker 2 participants 4 messages Oct 1, 2007 – Oct 2, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 6/11 : Insert feature-negotiation options into skb

[DCCP]: Insert feature-negotiation options into skb

The core insertion routine, provided by this patch, does a simple list walk and calls an already existing function in options.c to do the actual insertion of individual options.

This replaces the earlier insertion routine from options.c

---
 net/dccp/dccp.h    |    2 +
 net/dccp/feat.c    |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 net/dccp/options.c |   45 -----------------------------------------
 3 files changed, 59 insertions(+), 45 deletions(-)
net/dccp/dccp.h +2 -0
@@ -424,6 +424,8 @@ static inline int dccp_ack_pending(const
 
 extern int  dccp_feat_finalise_settings(struct dccp_sock *dp);
 extern int  dccp_feat_server_ccid_dependencies(struct dccp_request_sock *dreq);
+extern int  dccp_feat_insert_opts(struct dccp_sock*, struct dccp_request_sock*,
+				  struct sk_buff *skb);
 extern void dccp_feat_list_purge(struct list_head *fn_list);
 
 extern int dccp_insert_options(struct sock *sk, struct sk_buff *skb);
net/dccp/feat.c +57 -0

63 lines not on this page · raw message

net/dccp/options.c +0 -45

51 lines not on this page · raw message

Acked-by on v1 6/11
#1 lore raw
Quoted 8 lines · Gerrit Renker

[DCCP]: Insert feature-negotiation options into skb

The core insertion routine, provided by this patch, does a simple list walk and calls an already existing function in options.c to do the actual insertion of individual options.

This replaces the earlier insertion routine from options.c

Once a couple of things commented on/fixed.

Quoted 22 lines
---
 net/dccp/dccp.h    |    2 +
 net/dccp/feat.c    |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 net/dccp/options.c |   45 -----------------------------------------
 3 files changed, 59 insertions(+), 45 deletions(-)
net/dccp/dccp.h +2 -0
@@ -424,6 +424,8 @@ static inline int dccp_ack_pending(const
 
 extern int  dccp_feat_finalise_settings(struct dccp_sock *dp);
 extern int  dccp_feat_server_ccid_dependencies(struct dccp_request_sock *dreq);
+extern int  dccp_feat_insert_opts(struct dccp_sock*, struct dccp_request_sock*,
+                                 struct sk_buff *skb);
 extern void dccp_feat_list_purge(struct list_head *fn_list);
 
 extern int dccp_insert_options(struct sock *sk, struct sk_buff *skb);
net/dccp/feat.c +0 -0
@@ -334,6 +334,63 @@ static u8 dccp_feat_sp_list_ok(u8 feat_n
 }
 

net/dccp/feat.c static u8 dccp_feat_sp_list_ok(u8 feat_n · line 345

Quoted 10 lines
net/dccp/feat.c +9 -0
 /**
+ * dccp_feat_insert_opts  -  Generate FN options from current list state
+ * @skb: next sk_buff to be sent to the peer
+ * @dp: for client during handshake and general negotiation
+ * @dreq: used by the server only (all Changes/Confirms in LISTEN/RESPOND)
+ */
+int dccp_feat_insert_opts(struct dccp_sock *dp, struct dccp_request_sock *dreq,
+                         struct sk_buff *skb)
+{
+       struct list_head *fn = dreq? &dreq->dreq_featneg : &dp->dccps_featneg;

need a space before ? as per Arnaldo's email.

net/dccp/feat.c static u8 dccp_feat_sp_list_ok(u8 feat_n · line 347

Quoted 2 lines
net/dccp/feat.c +2 -0
+       struct dccp_feat_entry *pos, *next;
+       u8 opt, type, len, *ptr, nn_in_nbo[6];

I think the 6 should be a constant of some kind.

Signature · 3 lines
Web1: http://wand.net.nz/~iam4/
Web2: http://www.jandi.co.nz
Blog: http://iansblog.jandi.co.nz
#2 lore raw
In reply to Gerrit Renker

Revised patch following suggestions on the list.
Changes:
* now uses constant to allocate space for variable-length option (nn_in_nbo[DCCP_OPTVAL_MAXLEN])
* added a hunk which referenced the function dccp_insert_options_feat() which is replaced by this patch so that the patch can be compiled standalone
* updates in coding style (but that has been done for all other patches also)

-------------------------> Patch v2 <----------------------------------------------------------- [DCCP]: Insert feature-negotiation options into skb

The core insertion routine, provided by this patch, does a simple list walk and calls an already existing function in options.c to do the actual insertion of individual options.

This replaces the earlier insertion routine from options.c

---
 net/dccp/dccp.h    |    2 +
 net/dccp/feat.c    |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++
 net/dccp/options.c |   60 -----------------------------------------------------
 3 files changed, 59 insertions(+), 60 deletions(-)
net/dccp/dccp.h +2 -0
@@ -424,6 +424,8 @@ static inline int dccp_ack_pending(const
 
 extern int  dccp_feat_finalise_settings(struct dccp_sock *dp);
 extern int  dccp_feat_server_ccid_dependencies(struct dccp_request_sock *dreq);
+extern int  dccp_feat_insert_opts(struct dccp_sock*, struct dccp_request_sock*,
+				  struct sk_buff *skb);
 extern void dccp_feat_list_purge(struct list_head *fn_list);
 
 extern int dccp_insert_options(struct sock *sk, struct sk_buff *skb);
net/dccp/feat.c +57 -0

63 lines not on this page · raw message

net/dccp/options.c +0 -60

72 lines not on this page · raw message

Acked-by on v1 6/11
#3 lore raw
In reply to Gerrit Renker
Quoted 10 lines · Gerrit Renker

Revised patch following suggestions on the list.
Changes:
* now uses constant to allocate space for variable-length option (nn_in_nbo[DCCP_OPTVAL_MAXLEN])
* added a hunk which referenced the function dccp_insert_options_feat() which is replaced by this patch so that the patch can be compiled standalone
* updates in coding style (but that has been done for all other patches also)

-------------------------> Patch v2 <----------------------------------------------------------- [DCCP]: Insert feature-negotiation options into skb

Quoted 6 lines

The core insertion routine, provided by this patch, does a simple list walk and calls an already existing function in options.c to do the actual insertion of individual options.

This replaces the earlier insertion routine from options.c

Signature · 3 lines
Web1: http://wand.net.nz/~iam4/
Web2: http://www.jandi.co.nz
Blog: http://iansblog.jandi.co.nz