Lines Matching defs:rtnl
280 log_debug("rtnl: kernel receive buffer overrun");
282 log_debug("rtnl: no data in socket");
289 log_debug("rtnl: ignoring message from portid %"PRIu32, sender.nl.nl_pid);
323 int socket_read_message(sd_netlink *rtnl) {
333 assert(rtnl);
334 assert(rtnl->rbuffer);
335 assert(rtnl->rbuffer_allocated >= sizeof(struct nlmsghdr));
338 r = socket_recv_message(rtnl->fd, &iov, NULL, true);
345 if (!greedy_realloc((void **)&rtnl->rbuffer,
346 &rtnl->rbuffer_allocated,
350 iov.iov_base = rtnl->rbuffer;
351 iov.iov_len = rtnl->rbuffer_allocated;
354 r = socket_recv_message(rtnl->fd, &iov, &group, false);
360 if (len > rtnl->rbuffer_allocated)
364 if (NLMSG_OK(rtnl->rbuffer, len) && rtnl->rbuffer->nlmsg_flags & NLM_F_MULTI) {
367 for (i = 0; i < rtnl->rqueue_partial_size; i++) {
368 if (rtnl_message_get_serial(rtnl->rqueue_partial[i]) ==
369 rtnl->rbuffer->nlmsg_seq) {
370 first = rtnl->rqueue_partial[i];
376 for (new_msg = rtnl->rbuffer; NLMSG_OK(new_msg, len) && !done; new_msg = NLMSG_NEXT(new_msg, len)) {
380 if (!group && new_msg->nlmsg_pid != rtnl->sockaddr.nl.nl_pid)
413 r = message_new_empty(rtnl, &m);
443 r = rtnl_rqueue_make_room(rtnl);
447 rtnl->rqueue[rtnl->rqueue_size ++] = first;
450 if (multi_part && (i < rtnl->rqueue_partial_size)) {
452 memmove(rtnl->rqueue_partial + i,rtnl->rqueue_partial + i + 1,
453 sizeof(sd_netlink_message*) * (rtnl->rqueue_partial_size - i - 1));
454 rtnl->rqueue_partial_size --;
461 if (i < rtnl->rqueue_partial_size) {
462 rtnl->rqueue_partial[i] = first;
464 r = rtnl_rqueue_partial_make_room(rtnl);
468 rtnl->rqueue_partial[rtnl->rqueue_partial_size ++] = first;