Home
last modified time | relevance | path

Searched refs:cmsg_len (Results 1 – 25 of 45) sorted by relevance

12

/linux-6.12.1/tools/testing/selftests/net/
Dcmsg_sender.c225 ca_write_cmsg_u32(char *cbuf, size_t cbuf_sz, size_t *cmsg_len, in ca_write_cmsg_u32() argument
233 cmsg = (struct cmsghdr *)(cbuf + *cmsg_len); in ca_write_cmsg_u32()
234 *cmsg_len += CMSG_SPACE(sizeof(__u32)); in ca_write_cmsg_u32()
235 if (cbuf_sz < *cmsg_len) in ca_write_cmsg_u32()
240 cmsg->cmsg_len = CMSG_LEN(sizeof(__u32)); in ca_write_cmsg_u32()
248 size_t cmsg_len; in cs_write_cmsg() local
251 cmsg_len = 0; in cs_write_cmsg()
253 ca_write_cmsg_u32(cbuf, cbuf_sz, &cmsg_len, in cs_write_cmsg()
255 ca_write_cmsg_u32(cbuf, cbuf_sz, &cmsg_len, in cs_write_cmsg()
257 ca_write_cmsg_u32(cbuf, cbuf_sz, &cmsg_len, in cs_write_cmsg()
[all …]
Dudpgso_bench_tx.c320 cm->cmsg_len = CMSG_LEN(sizeof(cfg_tx_ts)); in send_ts_cmsg()
384 cm->cmsg_len = CMSG_LEN(sizeof(cfg_gso_size)); in send_udp_segment_cmsg()
Dipv6_flowlabel.c78 cm->cmsg_len = CMSG_LEN(sizeof(flowlabel)); in do_send()
Dnettest.c986 cm->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo)); in send_msg_cmsg()
990 m.msg_controllen = cm->cmsg_len; in send_msg_cmsg()
997 cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); in send_msg_cmsg()
1002 m.msg_controllen = cm->cmsg_len; in send_msg_cmsg()
Dtxtimestamp.c317 cm && cm->cmsg_len; in __recv_errmsg_cmsg()
636 cmsg->cmsg_len = CMSG_LEN(sizeof(uint32_t)); in do_test()
/linux-6.12.1/net/
Dcompat.c126 struct compat_cmsghdr __user *cmsg, int cmsg_len) in cmsg_compat_nxthdr() argument
128 char __user *ptr = (char __user *)cmsg + CMSG_COMPAT_ALIGN(cmsg_len); in cmsg_compat_nxthdr()
155 if (get_user(ucmlen, &ucmsg->cmsg_len)) in cmsghdr_from_user_compat_to_kern()
187 if (!CMSG_COMPAT_OK(cmsg.cmsg_len, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
189 tmp = ((cmsg.cmsg_len - sizeof(*ucmsg)) + sizeof(struct cmsghdr)); in cmsghdr_from_user_compat_to_kern()
192 kcmsg->cmsg_len = tmp; in cmsghdr_from_user_compat_to_kern()
198 (cmsg.cmsg_len - sizeof(*ucmsg)))) in cmsghdr_from_user_compat_to_kern()
203 ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, cmsg.cmsg_len); in cmsghdr_from_user_compat_to_kern()
269 cmhdr.cmsg_len = cmlen; in put_cmsg_compat()
312 err = put_user(cmlen, &cm->cmsg_len); in scm_detach_fds_compat()
/linux-6.12.1/net/ipv6/
Ddatagram.c796 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct in6_pktinfo))) { in ip6_datagram_send_ctl()
849 if (cmsg->cmsg_len < CMSG_LEN(4)) { in ip6_datagram_send_ctl()
865 if (opt->hopopt || cmsg->cmsg_len < CMSG_LEN(sizeof(struct ipv6_opt_hdr))) { in ip6_datagram_send_ctl()
872 if (cmsg->cmsg_len < CMSG_LEN(len)) { in ip6_datagram_send_ctl()
885 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct ipv6_opt_hdr))) { in ip6_datagram_send_ctl()
892 if (cmsg->cmsg_len < CMSG_LEN(len)) { in ip6_datagram_send_ctl()
910 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct ipv6_opt_hdr))) { in ip6_datagram_send_ctl()
917 if (cmsg->cmsg_len < CMSG_LEN(len)) { in ip6_datagram_send_ctl()
936 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct ipv6_rt_hdr))) { in ip6_datagram_send_ctl()
960 if (cmsg->cmsg_len < CMSG_LEN(len)) { in ip6_datagram_send_ctl()
[all …]
/linux-6.12.1/net/core/
Dscm.c74 num = (cmsg->cmsg_len - sizeof(struct cmsghdr))/sizeof(int); in scm_fp_copy()
185 if (cmsg->cmsg_len != CMSG_LEN(sizeof(struct ucred))) in __scm_send()
255 unsafe_put_user(cmlen, &cm->cmsg_len, efault_end); in put_cmsg()
266 cm->cmsg_len = cmlen; in put_cmsg()
351 err = put_user(cmlen, &cm->cmsg_len); in scm_detach_fds()
/linux-6.12.1/tools/perf/trace/beauty/include/linux/
Dsocket.h106 __kernel_size_t cmsg_len; /* data byte count, including hdr */ member
132 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \
133 (cmsg)->cmsg_len <= (unsigned long) \
159 __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len)); in __cmsg_nxthdr()
/linux-6.12.1/include/linux/
Dsocket.h106 __kernel_size_t cmsg_len; /* data byte count, including hdr */ member
132 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \
133 (cmsg)->cmsg_len <= (unsigned long) \
159 __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len)); in __cmsg_nxthdr()
/linux-6.12.1/Documentation/networking/
Dtls.rst139 int cmsg_len = sizeof(record_type);
141 char buf[CMSG_SPACE(cmsg_len)];
149 cmsg->cmsg_len = CMSG_LEN(cmsg_len);
151 msg.msg_controllen = cmsg->cmsg_len;
/linux-6.12.1/tools/testing/selftests/landlock/
Dcommon.h186 if (cmsg->cmsg_len != CMSG_LEN(sizeof(fd_rx))) in recv_fd()
214 cmsg->cmsg_len = CMSG_LEN(sizeof(fd_tx)); in send_fd()
/linux-6.12.1/samples/seccomp/
Duser-trap.c50 cmsg->cmsg_len = CMSG_LEN(sizeof(int)); in send_fd()
53 msg.msg_controllen = cmsg->cmsg_len; in send_fd()
/linux-6.12.1/include/net/
Dcompat.h26 compat_size_t cmsg_len; member
/linux-6.12.1/net/handshake/
Dalert.c59 cmsg->cmsg_len = CMSG_LEN(sizeof(record_type)); in tls_alert_send()
/linux-6.12.1/net/rds/
Drdma.c625 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_rdma_args)) in rds_cmsg_rdma_args()
819 if (cmsg->cmsg_len < CMSG_LEN(sizeof(rds_rdma_cookie_t)) || in rds_cmsg_rdma_dest()
857 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_get_mr_args)) || in rds_cmsg_rdma_map()
875 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_atomic_args)) in rds_cmsg_atomic()
/linux-6.12.1/tools/testing/selftests/net/af_unix/
Dscm_pidfd.c165 if (cmsg->cmsg_len < sizeof(*pidfd)) { in cmsg_check()
175 if (cmsg->cmsg_len < sizeof(*ucred)) { in cmsg_check()
Dscm_rights.c209 .cmsg_len = CMSG_LEN(sizeof(cmsg.fd)), in __send_fd()
/linux-6.12.1/net/ipv4/
Dip_sockglue.c258 if (cmsg->cmsg_len < CMSG_LEN(sizeof(*src_info))) in ip_cmsg_send()
280 err = cmsg->cmsg_len - sizeof(struct cmsghdr); in ip_cmsg_send()
292 if (cmsg->cmsg_len != CMSG_LEN(sizeof(struct in_pktinfo))) in ip_cmsg_send()
301 if (cmsg->cmsg_len != CMSG_LEN(sizeof(int))) in ip_cmsg_send()
309 if (cmsg->cmsg_len == CMSG_LEN(sizeof(int))) in ip_cmsg_send()
311 else if (cmsg->cmsg_len == CMSG_LEN(sizeof(u8))) in ip_cmsg_send()
321 if (cmsg->cmsg_len != CMSG_LEN(sizeof(int))) in ip_cmsg_send()
/linux-6.12.1/tools/testing/selftests/bpf/prog_tests/
Dlwt_reroute.c124 cmsg->cmsg_len = CMSG_LEN(sizeof(uint64_t)); in overflow_fq()
Dcrypto_sanity.c62 cmsg->cmsg_len = CMSG_LEN(4); in do_crypt_afalg()
Dtoken.c169 cmsg->cmsg_len = CMSG_LEN(sizeof(fds)); in sendfd()
210 !ASSERT_EQ(cmsg->cmsg_len, CMSG_LEN(sizeof(fds)), "cmsg_len") || in recvfd()
/linux-6.12.1/crypto/
Daf_alg.c571 if (cmsg->cmsg_len < CMSG_LEN(sizeof(*con->iv))) in af_alg_cmsg_send()
574 if (cmsg->cmsg_len < CMSG_LEN(con->iv->ivlen + in af_alg_cmsg_send()
580 if (cmsg->cmsg_len < CMSG_LEN(sizeof(u32))) in af_alg_cmsg_send()
586 if (cmsg->cmsg_len < CMSG_LEN(sizeof(u32))) in af_alg_cmsg_send()
/linux-6.12.1/arch/um/os-Linux/
Dfile.c559 memcpy(fds, CMSG_DATA(cmsg), cmsg->cmsg_len); in os_rcv_fd_msg()
690 cmsg->cmsg_len = CMSG_LEN(fds_size); in os_sendmsg_fds()
/linux-6.12.1/tools/testing/selftests/net/lib/
Dcsum.c711 if (cm->cmsg_len != CMSG_LEN(sizeof(struct tpacket_auxdata))) in recv_get_packet_csum_status()
713 cm->cmsg_len, CMSG_LEN(sizeof(struct tpacket_auxdata))); in recv_get_packet_csum_status()

12