mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
af_iucv: allow retrieval of maximum message size
For HS transport the maximum message size depends on the MTU-size of the HS-device bound to the AF_IUCV socket. This patch adds a getsockopt option MSGSIZE returning the maximum message size that can be handled for this AF_IUCV socket. Signed-off-by: Ursula Braun <[email protected]> Signed-off-by: Frank Blaschka <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
800c5eb7b5
commit
51363b8751
2 changed files with 10 additions and 1 deletions
|
|
@ -1633,7 +1633,8 @@ static int iucv_sock_getsockopt(struct socket *sock, int level, int optname,
|
|||
{
|
||||
struct sock *sk = sock->sk;
|
||||
struct iucv_sock *iucv = iucv_sk(sk);
|
||||
int val, len;
|
||||
unsigned int val;
|
||||
int len;
|
||||
|
||||
if (level != SOL_IUCV)
|
||||
return -ENOPROTOOPT;
|
||||
|
|
@ -1656,6 +1657,13 @@ static int iucv_sock_getsockopt(struct socket *sock, int level, int optname,
|
|||
: iucv->msglimit; /* default */
|
||||
release_sock(sk);
|
||||
break;
|
||||
case SO_MSGSIZE:
|
||||
if (sk->sk_state == IUCV_OPEN)
|
||||
return -EBADFD;
|
||||
val = (iucv->hs_dev) ? iucv->hs_dev->mtu -
|
||||
sizeof(struct af_iucv_trans_hdr) - ETH_HLEN :
|
||||
0x7fffffff;
|
||||
break;
|
||||
default:
|
||||
return -ENOPROTOOPT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue