Lines Matching full:sfd

1019 static int mptcp_put_subflow_data(struct mptcp_subflow_data *sfd,  in mptcp_put_subflow_data()  argument
1024 u32 copylen = min_t(u32, sfd->size_subflow_data, sizeof(*sfd)); in mptcp_put_subflow_data()
1027 copied += sfd->size_subflow_data; in mptcp_put_subflow_data()
1034 if (copy_to_user(optval, sfd, copylen)) in mptcp_put_subflow_data()
1040 static int mptcp_get_subflow_data(struct mptcp_subflow_data *sfd, in mptcp_get_subflow_data() argument
1052 BUILD_BUG_ON(sizeof(*sfd) != MIN_INFO_OPTLEN_SIZE); in mptcp_get_subflow_data()
1057 memset(sfd, 0, sizeof(*sfd)); in mptcp_get_subflow_data()
1059 copylen = min_t(unsigned int, len, sizeof(*sfd)); in mptcp_get_subflow_data()
1060 if (copy_from_user(sfd, optval, copylen)) in mptcp_get_subflow_data()
1064 if (sfd->size_subflow_data > INT_MAX || in mptcp_get_subflow_data()
1065 sfd->size_user > INT_MAX) in mptcp_get_subflow_data()
1068 if (sfd->size_subflow_data < MIN_INFO_OPTLEN_SIZE || in mptcp_get_subflow_data()
1069 sfd->size_subflow_data > len) in mptcp_get_subflow_data()
1072 if (sfd->num_subflows || sfd->size_kernel) in mptcp_get_subflow_data()
1075 return len - sfd->size_subflow_data; in mptcp_get_subflow_data()
1084 struct mptcp_subflow_data sfd; in mptcp_getsockopt_tcpinfo() local
1088 len = mptcp_get_subflow_data(&sfd, optval, optlen); in mptcp_getsockopt_tcpinfo()
1092 sfd.size_kernel = sizeof(struct tcp_info); in mptcp_getsockopt_tcpinfo()
1093 sfd.size_user = min_t(unsigned int, sfd.size_user, in mptcp_getsockopt_tcpinfo()
1096 infoptr = optval + sfd.size_subflow_data; in mptcp_getsockopt_tcpinfo()
1105 if (len && len >= sfd.size_user) { in mptcp_getsockopt_tcpinfo()
1110 if (copy_to_user(infoptr, &info, sfd.size_user)) { in mptcp_getsockopt_tcpinfo()
1115 infoptr += sfd.size_user; in mptcp_getsockopt_tcpinfo()
1116 copied += sfd.size_user; in mptcp_getsockopt_tcpinfo()
1117 len -= sfd.size_user; in mptcp_getsockopt_tcpinfo()
1123 sfd.num_subflows = sfcount; in mptcp_getsockopt_tcpinfo()
1125 if (mptcp_put_subflow_data(&sfd, optval, copied, optlen)) in mptcp_getsockopt_tcpinfo()
1176 struct mptcp_subflow_data sfd; in mptcp_getsockopt_subflow_addrs() local
1180 len = mptcp_get_subflow_data(&sfd, optval, optlen); in mptcp_getsockopt_subflow_addrs()
1184 sfd.size_kernel = sizeof(struct mptcp_subflow_addrs); in mptcp_getsockopt_subflow_addrs()
1185 sfd.size_user = min_t(unsigned int, sfd.size_user, in mptcp_getsockopt_subflow_addrs()
1188 addrptr = optval + sfd.size_subflow_data; in mptcp_getsockopt_subflow_addrs()
1197 if (len && len >= sfd.size_user) { in mptcp_getsockopt_subflow_addrs()
1202 if (copy_to_user(addrptr, &a, sfd.size_user)) { in mptcp_getsockopt_subflow_addrs()
1207 addrptr += sfd.size_user; in mptcp_getsockopt_subflow_addrs()
1208 copied += sfd.size_user; in mptcp_getsockopt_subflow_addrs()
1209 len -= sfd.size_user; in mptcp_getsockopt_subflow_addrs()
1215 sfd.num_subflows = sfcount; in mptcp_getsockopt_subflow_addrs()
1217 if (mptcp_put_subflow_data(&sfd, optval, copied, optlen)) in mptcp_getsockopt_subflow_addrs()