Skip to contentSkip to conversation

: Provide documentation for undocumented sockopt struct

PATCH In review Gerrit Renker 1 participant 1 message Sep 27, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 9/11 : Provide documentation for undocumented sockopt struct

[DCCP]: Provide documentation for undocumented sockopt struct

Also changed the type of the value pointer to void*, to enable passing NN values (up to 48 bit) onto the socket.

FIXME: I think that this struct might be useful for testing, but it
would be better to phase it out and replace it by proper socket options (setsockopt code for the CCID follows in a later patch).

---
 include/linux/dccp.h |   13 +++++++++----
 net/dccp/proto.c     |    1 -
 2 files changed, 9 insertions(+), 5 deletions(-)
include/linux/dccp.h +9 -4
@@ -191,11 +191,16 @@ enum dccp_feature_numbers {
 	DCCPF_MAX_CCID_SPECIFIC = 255,
 };
 
-/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */
+/**
+ * struct dccp_so_feat  -  setsockopt struct struct for DCCP_SOCKOPT_CHANGE_X
+ * @dccpsf_feat: feature number (from RFC 4340, 6.4 or related)
+ * @dccpsf_val: single u64 NN value or SP value (u8) plus preference list (u8)
+ * @dccpsf_len: length of @dccpsf_val in bytes (ie. 8 when NN, min 1 when SP)
+ */
 struct dccp_so_feat {
-	__u8 dccpsf_feat;
-	__u8 __user *dccpsf_val;
-	__u8 dccpsf_len;
+	__u8		dccpsf_feat;
+	void __user	*dccpsf_val;
+	__u8		dccpsf_len;
 };
 
 /* DCCP socket options */
net/dccp/proto.c +0 -1
@@ -441,7 +441,6 @@ static int dccp_setsockopt_service(struc
 	return 0;
 }
 
-/* byte 1 is feature.  the rest is the preference list */
 static int dccp_setsockopt_change(struct sock *sk, int type,
 				  struct dccp_so_feat __user *optval)