• Home
  • Raw
  • Download

Lines Matching full:sfd

992 static int mptcp_put_subflow_data(struct mptcp_subflow_data *sfd,  in mptcp_put_subflow_data()  argument
997 u32 copylen = min_t(u32, sfd->size_subflow_data, sizeof(*sfd)); in mptcp_put_subflow_data()
1000 copied += sfd->size_subflow_data; in mptcp_put_subflow_data()
1007 if (copy_to_user(optval, sfd, copylen)) in mptcp_put_subflow_data()
1013 static int mptcp_get_subflow_data(struct mptcp_subflow_data *sfd, in mptcp_get_subflow_data() argument
1025 BUILD_BUG_ON(sizeof(*sfd) != MIN_INFO_OPTLEN_SIZE); in mptcp_get_subflow_data()
1030 memset(sfd, 0, sizeof(*sfd)); in mptcp_get_subflow_data()
1032 copylen = min_t(unsigned int, len, sizeof(*sfd)); in mptcp_get_subflow_data()
1033 if (copy_from_user(sfd, optval, copylen)) in mptcp_get_subflow_data()
1037 if (sfd->size_subflow_data > INT_MAX || in mptcp_get_subflow_data()
1038 sfd->size_user > INT_MAX) in mptcp_get_subflow_data()
1041 if (sfd->size_subflow_data < MIN_INFO_OPTLEN_SIZE || in mptcp_get_subflow_data()
1042 sfd->size_subflow_data > len) in mptcp_get_subflow_data()
1045 if (sfd->num_subflows || sfd->size_kernel) in mptcp_get_subflow_data()
1048 return len - sfd->size_subflow_data; in mptcp_get_subflow_data()
1057 struct mptcp_subflow_data sfd; in mptcp_getsockopt_tcpinfo() local
1061 len = mptcp_get_subflow_data(&sfd, optval, optlen); in mptcp_getsockopt_tcpinfo()
1065 sfd.size_kernel = sizeof(struct tcp_info); in mptcp_getsockopt_tcpinfo()
1066 sfd.size_user = min_t(unsigned int, sfd.size_user, in mptcp_getsockopt_tcpinfo()
1069 infoptr = optval + sfd.size_subflow_data; in mptcp_getsockopt_tcpinfo()
1078 if (len && len >= sfd.size_user) { in mptcp_getsockopt_tcpinfo()
1083 if (copy_to_user(infoptr, &info, sfd.size_user)) { in mptcp_getsockopt_tcpinfo()
1088 infoptr += sfd.size_user; in mptcp_getsockopt_tcpinfo()
1089 copied += sfd.size_user; in mptcp_getsockopt_tcpinfo()
1090 len -= sfd.size_user; in mptcp_getsockopt_tcpinfo()
1096 sfd.num_subflows = sfcount; in mptcp_getsockopt_tcpinfo()
1098 if (mptcp_put_subflow_data(&sfd, optval, copied, optlen)) in mptcp_getsockopt_tcpinfo()
1149 struct mptcp_subflow_data sfd; in mptcp_getsockopt_subflow_addrs() local
1153 len = mptcp_get_subflow_data(&sfd, optval, optlen); in mptcp_getsockopt_subflow_addrs()
1157 sfd.size_kernel = sizeof(struct mptcp_subflow_addrs); in mptcp_getsockopt_subflow_addrs()
1158 sfd.size_user = min_t(unsigned int, sfd.size_user, in mptcp_getsockopt_subflow_addrs()
1161 addrptr = optval + sfd.size_subflow_data; in mptcp_getsockopt_subflow_addrs()
1170 if (len && len >= sfd.size_user) { in mptcp_getsockopt_subflow_addrs()
1175 if (copy_to_user(addrptr, &a, sfd.size_user)) { in mptcp_getsockopt_subflow_addrs()
1180 addrptr += sfd.size_user; in mptcp_getsockopt_subflow_addrs()
1181 copied += sfd.size_user; in mptcp_getsockopt_subflow_addrs()
1182 len -= sfd.size_user; in mptcp_getsockopt_subflow_addrs()
1188 sfd.num_subflows = sfcount; in mptcp_getsockopt_subflow_addrs()
1190 if (mptcp_put_subflow_data(&sfd, optval, copied, optlen)) in mptcp_getsockopt_subflow_addrs()