From dff4879c8c5684768978108ea0d5296b33c68aa3 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 9 Apr 2024 13:16:52 +0300 Subject: [PATCH] Check if NBD_ATTR_BACKEND_IDENTIFIER is defined --- src/nbd_proxy.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nbd_proxy.cpp b/src/nbd_proxy.cpp index fad22e36..e82a7892 100644 --- a/src/nbd_proxy.cpp +++ b/src/nbd_proxy.cpp @@ -161,12 +161,14 @@ static int netlink_configure(const int *sockfd, int sock_size, int dev_num, uint NLA_PUT_U64(msg, NBD_ATTR_DEAD_CONN_TIMEOUT, conn_timeout); } +#ifdef NBD_ATTR_BACKEND_IDENTIFIER if (backend) { // Backend is an attribute useful for identication of the device // Also it prevents reconfiguration of the device with a different backend string NLA_PUT_STRING(msg, NBD_ATTR_BACKEND_IDENTIFIER, backend); } +#endif msg_attr = nla_nest_start(msg, NBD_ATTR_SOCKETS); if (!msg_attr)