From 86a3c42dda09a8b9e23d34ebc8729c826a7571f5 Mon Sep 17 00:00:00 2001 From: Pavel Tikhomirov Date: Thu, 25 Jun 2026 22:07:14 +0300 Subject: [PATCH] sk-queue: use flags in dump_sk_queue Signed-off-by: Pavel Tikhomirov (cherry picked from commit 8b83405614703211fee27f90f08450cba080a44c) Ahmed Elaidy: - adapted onto the upstream 2-arg dump_sk_queue(): upstream has no netlink queue dump, so there was no bool dump_addr argument to convert; introduce int flags on the 2-arg base and update the only caller (unix sockets). No sk-netlink.c change for the same reason. Signed-off-by: Ahmed Elaidy Reviewed-by: Alexander Mikhalitsyn --- criu/include/sk-queue.h | 3 ++- criu/sk-queue.c | 2 +- criu/sk-unix.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/criu/include/sk-queue.h b/criu/include/sk-queue.h index e0a47af1b..ffcd6b21e 100644 --- a/criu/include/sk-queue.h +++ b/criu/include/sk-queue.h @@ -2,7 +2,8 @@ #define __CR_SK_QUEUE_H__ extern struct collect_image_info sk_queues_cinfo; -extern int dump_sk_queue(int sock_fd, int sock_id); + +extern int dump_sk_queue(int sock_fd, int sock_id, int flags); extern int restore_sk_queue(int fd, unsigned int peer_id); #endif /* __CR_SK_QUEUE_H__ */ diff --git a/criu/sk-queue.c b/criu/sk-queue.c index 1af9a6aed..6158f5da0 100644 --- a/criu/sk-queue.c +++ b/criu/sk-queue.c @@ -174,7 +174,7 @@ static void release_cmsg(SkPacketEntry *pe) pe->scm = NULL; } -int dump_sk_queue(int sock_fd, int sock_id) +int dump_sk_queue(int sock_fd, int sock_id, int flags) { SkPacketEntry pe = SK_PACKET_ENTRY__INIT; int ret, size, orig_peek_off; diff --git a/criu/sk-unix.c b/criu/sk-unix.c index f309af925..3eaabb074 100644 --- a/criu/sk-unix.c +++ b/criu/sk-unix.c @@ -408,7 +408,7 @@ static int dump_one_unix_fd(int lfd, uint32_t id, const struct fd_parms *p) * (i stands for in-flight, cons -- for connections) things. */ if (sk->rqlen != 0 && sk->state != TCP_LISTEN) { - if (dump_sk_queue(lfd, id)) + if (dump_sk_queue(lfd, id, 0)) goto err; }