/linux-6.3-rc2/tools/include/uapi/linux/ |
A D | netlink.h | 45 __u32 nlmsg_len; /* Length of message including header */ member 95 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ 96 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) 98 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ 99 (nlh)->nlmsg_len <= (len)) 100 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
|
/linux-6.3-rc2/include/uapi/linux/ |
A D | netlink.h | 53 __u32 nlmsg_len; member 104 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ 106 NLMSG_ALIGN((nlh)->nlmsg_len))) 108 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ 109 (nlh)->nlmsg_len <= (len)) 110 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
|
/linux-6.3-rc2/drivers/scsi/ |
A D | scsi_netlink.c | 43 if ((nlh->nlmsg_len < (sizeof(*nlh) + sizeof(*hdr))) || in scsi_nl_rcv_msg() 44 (skb->len < nlh->nlmsg_len)) { in scsi_nl_rcv_msg() 50 rlen = NLMSG_ALIGN(nlh->nlmsg_len); in scsi_nl_rcv_msg() 71 if (nlh->nlmsg_len < (sizeof(*nlh) + hdr->msglen)) { in scsi_nl_rcv_msg()
|
/linux-6.3-rc2/tools/testing/selftests/bpf/prog_tests/ |
A D | xfrm_info.c | 190 (struct rtattr *)((uint8_t *)nh + RTA_ALIGN(nh->nlmsg_len)); in rtattr_add() 193 nh->nlmsg_len = RTA_ALIGN(nh->nlmsg_len) + RTA_ALIGN(rta->rta_len); in rtattr_add() 213 uint8_t *end = (uint8_t *)nh + nh->nlmsg_len; in rtattr_end() 232 nh->nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in setup_xfrmi_external_dev() 251 ret = send(sock, nh, nh->nlmsg_len, 0); in setup_xfrmi_external_dev() 252 if (!ASSERT_EQ(ret, nh->nlmsg_len, "netlink send length")) in setup_xfrmi_external_dev()
|
/linux-6.3-rc2/tools/testing/selftests/net/ |
A D | tun.c | 84 req.nh.nlmsg_len = NLMSG_ALIGN(NLMSG_LENGTH(sizeof(req.ifm))); in tun_delete() 90 rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.nh.nlmsg_len)); in tun_delete() 93 req.nh.nlmsg_len += rta->rta_len; in tun_delete() 96 ret = send(rtnl, &req, req.nh.nlmsg_len, 0); in tun_delete() 99 ret = (unsigned int)ret != req.nh.nlmsg_len; in tun_delete()
|
A D | tap.c | 37 (struct rtattr *)((uint8_t *)nh + RTA_ALIGN(nh->nlmsg_len)); in rtattr_add() 40 nh->nlmsg_len = RTA_ALIGN(nh->nlmsg_len) + RTA_ALIGN(rta->rta_len); in rtattr_add() 51 uint8_t *end = (uint8_t *)nh + nh->nlmsg_len; in rtattr_end() 102 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in dev_create() 134 ret = send(rtnl, &req, req.nh.nlmsg_len, 0); in dev_create() 137 ret = (unsigned int)ret != req.nh.nlmsg_len; in dev_create() 159 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in dev_delete() 167 ret = send(rtnl, &req, req.nh.nlmsg_len, 0); in dev_delete() 171 ret = (unsigned int)ret != req.nh.nlmsg_len; in dev_delete()
|
A D | ipsec.c | 226 nh->nlmsg_len = nl_size; in rtattr_pack() 254 char *nlmsg_end = (char *)nh + nh->nlmsg_len; in rtattr_end() 320 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in veth_add() 350 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in veth_add() 368 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in ip4_addr_set() 392 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in ip4_addr_set() 418 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in link_set_up() 436 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt)); in ip4_route_set() 456 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in ip4_route_set() 1024 req.nh.nlmsg_len = NLMSG_LENGTH(0); in xfrm_state_check() [all …]
|
/linux-6.3-rc2/tools/bpf/bpftool/ |
A D | net.c | 207 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*t)); in __dump_class_nlmsg() 222 .nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)), in netlink_get_class() 231 if (send(sock, &req, req.nlh.nlmsg_len, 0) < 0) in netlink_get_class() 246 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*t)); in __dump_qdisc_nlmsg() 261 .nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)), in netlink_get_qdisc() 270 if (send(sock, &req, req.nlh.nlmsg_len, 0) < 0) in netlink_get_qdisc() 285 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*t)); in __dump_filter_nlmsg() 300 .nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)), in netlink_get_filter() 310 if (send(sock, &req, req.nlh.nlmsg_len, 0) < 0) in netlink_get_filter() 324 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*ifi)); in __dump_link_nlmsg() [all …]
|
/linux-6.3-rc2/drivers/staging/gdm724x/ |
A D | netlink_k.c | 23 #define ND_NLMSG_R_LEN(nlh) ((nlh)->nlmsg_len - ND_IFINDEX_LEN) 49 if (skb->len < nlh->nlmsg_len || nlh->nlmsg_len > ND_MAX_MSG_LEN) { in netlink_rcv_cb() 51 skb->len, nlh->nlmsg_len); in netlink_rcv_cb()
|
/linux-6.3-rc2/tools/lib/bpf/ |
A D | nlattr.h | 138 return (struct nlattr *)((void *)req + NLMSG_ALIGN(req->nh.nlmsg_len)); in req_tail() 146 if (NLMSG_ALIGN(req->nh.nlmsg_len) + NLA_ALIGN(NLA_HDRLEN + len) > sizeof(*req)) in nlattr_add() 156 req->nh.nlmsg_len = NLMSG_ALIGN(req->nh.nlmsg_len) + NLA_ALIGN(nla->nla_len); in nlattr_add()
|
A D | nlattr.c | 81 static inline int nlmsg_len(const struct nlmsghdr *nlh) in nlmsg_len() function 83 return nlh->nlmsg_len - NLMSG_HDRLEN; in nlmsg_len() 178 hlen += nlmsg_len(&err->msg); in libbpf_nla_dump_errormsg() 181 alen = (void *)nlh + nlh->nlmsg_len - (void *)attr; in libbpf_nla_dump_errormsg()
|
A D | netlink.c | 236 if (send(sock, req, req->nh.nlmsg_len, 0) < 0) { in libbpf_netlink_send_recv() 269 .nh.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN), in libbpf_netlink_resolve_genl_family_id() 293 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); in __bpf_set_link_xdp_fd_replace() 350 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*ifi)); in __dump_link_nlmsg() 430 .nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)), in bpf_xdp_query() 475 req.nh.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); in bpf_xdp_query() 582 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in tc_qdisc_modify() 741 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_attach() 818 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in __bpf_tc_detach() 885 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_query()
|
/linux-6.3-rc2/net/netfilter/ |
A D | nfnetlink.c | 225 if (nlmsg_len(nlh) < sizeof(struct nfgenmsg)) in nfnetlink_rcv_msg() 259 int attrlen = nlh->nlmsg_len - min_len; in nfnetlink_rcv_msg() 444 if (nlh->nlmsg_len < NLMSG_HDRLEN || in nfnetlink_rcv_batch() 445 skb->len < nlh->nlmsg_len || in nfnetlink_rcv_batch() 446 nlmsg_len(nlh) < sizeof(struct nfgenmsg)) { in nfnetlink_rcv_batch() 497 int attrlen = nlh->nlmsg_len - min_len; in nfnetlink_rcv_batch() 555 msglen = NLMSG_ALIGN(nlh->nlmsg_len); in nfnetlink_rcv_batch() 610 int attrlen = nlh->nlmsg_len - min_len; in nfnetlink_rcv_skb_batch() 616 msglen = NLMSG_ALIGN(nlh->nlmsg_len); in nfnetlink_rcv_skb_batch() 648 nlh->nlmsg_len < NLMSG_HDRLEN || in nfnetlink_rcv() [all …]
|
/linux-6.3-rc2/drivers/connector/ |
A D | connector.c | 142 if (nlh->nlmsg_len < NLMSG_HDRLEN + sizeof(struct cn_msg) + msg->len) in cn_call_callback() 177 len = nlmsg_len(nlh); in cn_rx_skb() 180 skb->len < nlh->nlmsg_len || in cn_rx_skb()
|
/linux-6.3-rc2/tools/accounting/ |
A D | procacct.c | 136 msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); in send_cmd() 147 msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len); in send_cmd() 150 buflen = msg.n.nlmsg_len; in send_cmd() 369 sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len); in main()
|
A D | getdelays.c | 129 msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); in send_cmd() 140 msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len); in send_cmd() 143 buflen = msg.n.nlmsg_len ; in send_cmd() 479 sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len); in main()
|
/linux-6.3-rc2/include/net/ |
A D | netlink.h | 593 static inline int nlmsg_len(const struct nlmsghdr *nlh) in nlmsg_len() function 595 return nlh->nlmsg_len - NLMSG_HDRLEN; in nlmsg_len() 617 return nlmsg_len(nlh) - NLMSG_ALIGN(hdrlen); in nlmsg_attrlen() 628 nlh->nlmsg_len >= sizeof(struct nlmsghdr) && in nlmsg_ok() 629 nlh->nlmsg_len <= remaining); in nlmsg_ok() 643 int totlen = NLMSG_ALIGN(nlh->nlmsg_len); in nlmsg_next() 744 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) { in __nlmsg_parse() 888 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) in nlmsg_validate_deprecated() 1017 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh; in nlmsg_end()
|
/linux-6.3-rc2/drivers/infiniband/core/ |
A D | netlink.c | 221 if (nlh->nlmsg_len < NLMSG_HDRLEN || skb->len < nlh->nlmsg_len) in rdma_nl_rcv_skb() 248 msglen = NLMSG_ALIGN(nlh->nlmsg_len); in rdma_nl_rcv_skb()
|
/linux-6.3-rc2/tools/testing/selftests/net/af_unix/ |
A D | diag_uid.c | 85 .nlmsg_len = sizeof(req), in send_request() 162 render_response(_metadata, NLMSG_DATA(nlh), nlh->nlmsg_len); in receive_response()
|
/linux-6.3-rc2/tools/testing/selftests/netfilter/ |
A D | nf-queue.c | 230 if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { in open_queue() 242 if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { in open_queue() 317 if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { in mainloop()
|
/linux-6.3-rc2/tools/testing/vsock/ |
A D | vsock_diag_test.c | 174 .nlmsg_len = sizeof(req), in send_req() 288 if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) in read_vsock_stat() 303 if (h->nlmsg_len < in read_vsock_stat()
|
/linux-6.3-rc2/net/xfrm/ |
A D | xfrm_compat.c | 358 size_t len = nlmsg_len(src); in xfrm_user_rcv_calculate_len64() 420 nlmsg->nlmsg_len += nla->nla_len; in xfrm_attr_cpy32() 473 dst->nlmsg_len = NLMSG_HDRLEN + xfrm_msg_min[type]; in xfrm_xlate32() 545 pos = dst->nlmsg_len; in xfrm_xlate32() 612 if (len == nlmsg_len(h32)) in xfrm_user_rcv_msg_compat()
|
/linux-6.3-rc2/net/tipc/ |
A D | diag.c | 82 if (nlmsg_len(h) < hdrlen) in tipc_sock_diag_handler_dump()
|
/linux-6.3-rc2/tools/testing/selftests/net/mptcp/ |
A D | pm_nl_ctl.c | 59 nh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); in init_genl_req() 72 int len = nh->nlmsg_len - sizeof(*nh); in nl_error() 143 msg_len = nh->nlmsg_len - NLMSG_LENGTH(GENL_HDRLEN); in capture_events() 210 nh->nlmsg_len = len; in do_nl_req() 238 int len = nlh->nlmsg_len; in genl_parse_getfamily() 249 nlh->nlmsg_len, nlh->nlmsg_type); in genl_parse_getfamily() 1042 int len = nh->nlmsg_len; in print_addrs() 1120 nh->nlmsg_len = off; in dump_addrs() 1149 int len = nh->nlmsg_len; in print_limits()
|
/linux-6.3-rc2/samples/bpf/ |
A D | xdp_router_ipv4_user.c | 280 req.nl.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); in get_route_table() 290 iov.iov_len = req.nl.nlmsg_len; in get_route_table() 416 req.nl.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); in get_arp_table() 425 iov.iov_len = req.nl.nlmsg_len; in get_arp_table()
|