Gerrit Renker 69a6a0b38a dccp: allow probing of CCID-array length
This fixes a problem in the DCCP getsockopt() API: currently there is no way
for a user to a priori know the number of built-in CCIDs, other than trying
DCCP_SOCKOPT_AVAILABLE_CCIDS in a loop, incrementing the option length until
EINVAL is no longer returned.

This patch truncates the array to the user-provided length. No copy is made
when the length is <= 0.

Due to the length restriction in do_dccp_getsockopt() to sizeof(int), the
minimum array length remains 4, which is a reasonable default (only 3
CCIDs, CCID-2..4, are currently defined).

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12 11:47:00 -08:00
..
2010-02-03 19:00:30 -08:00
2009-08-05 10:42:58 -07:00
2010-01-17 19:16:02 -08:00
2010-01-17 19:16:02 -08:00
2009-10-18 18:52:53 -07:00
2010-02-03 19:00:31 -08:00
2009-10-18 18:52:53 -07:00
2009-10-20 18:55:46 -07:00