Add socket option to query the current MPS
Subsystems (2)
PATCH 20/29 Add socket option to query the current MPS
This enables applications to query the current value of the Maximum Packet Size via a socket option, suggested as a SHOULD in (RFC 4340, p. 102).
Signed-off-by Gerrit Renker <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- Documentation/networking/dccp.txt | 3 +++ include/linux/dccp.h | 1 + net/dccp/proto.c | 4 ++++ 3 files changed, 8 insertions(+), 0 deletions(-)
Documentation/networking/dccp.txt +3 -0
@@ -41,6 +41,9 @@ the socket will fall back to 0 (which means that no meaningful service code is present). Connecting sockets set at most one service option; for listening sockets, multiple service codes can be specified. +DCCP_SOCKOPT_GET_CUR_MPS is read-only and retrieves the current maximum packet +size (application payload size) in bytes, see RFC 4340, section 14. + DCCP_SOCKOPT_SEND_CSCOV and DCCP_SOCKOPT_RECV_CSCOV are used for setting the partial checksum coverage (RFC 4340, sec. 9.2). The default is that checksums always cover the entire packet and that only fully covered application data is
include/linux/dccp.h +1 -0
@@ -204,6 +204,7 @@ struct dccp_so_feat {#define DCCP_SOCKOPT_SERVICE 2#define DCCP_SOCKOPT_CHANGE_L 3#define DCCP_SOCKOPT_CHANGE_R 4 +#define DCCP_SOCKOPT_GET_CUR_MPS 5#define DCCP_SOCKOPT_SEND_CSCOV 10#define DCCP_SOCKOPT_RECV_CSCOV 11#define DCCP_SOCKOPT_CCID_RX_INFO 128
net/dccp/proto.c +4 -0
@@ -586,6 +586,10 @@ static int do_dccp_getsockopt(struct sock *sk, int level, int optname,case DCCP_SOCKOPT_SERVICE :return dccp_getsockopt_service (sk, len, (__be32 __user *)optval, optlen); +case DCCP_SOCKOPT_GET_CUR_MPS : + val = dp->dccps_mss_cache; + len =sizeof (val); +break ;case DCCP_SOCKOPT_SEND_CSCOV : val = dp->dccps_pcslen; len =sizeof (val);
Signature · 1 line
1.5.0.6