patch 'app/graph: fix variable shadowing' has been queued to stable release 25.11.1
Kevin Traynor
ktraynor at redhat.com
Thu Feb 26 14:08:23 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/02/26. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/84011af88d7f051281d4adcf9b796245ed2f81af
Thanks.
Kevin
---
>From 84011af88d7f051281d4adcf9b796245ed2f81af Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Wed, 14 Jan 2026 15:44:33 +0000
Subject: [PATCH] app/graph: fix variable shadowing
[ upstream commit 7cf4b28a211dd832847130036cfc83a670990f9a ]
The global variable "conn" conflicted with the local parameter to each
function in the graph conn.c file. To prevent shadowing, use "c" as the
name for the local connection variable throughout the file.
Fixes: 3f90eda5b7fb ("app/graph: add telnet connectivity")
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
app/graph/conn.c | 134 +++++++++++++++++++++++------------------------
1 file changed, 67 insertions(+), 67 deletions(-)
diff --git a/app/graph/conn.c b/app/graph/conn.c
index 44934602c7..c5e1c1ae1b 100644
--- a/app/graph/conn.c
+++ b/app/graph/conn.c
@@ -21,10 +21,10 @@
static int
-data_event_handle(struct conn *conn, int fd_client)
+data_event_handle(struct conn *c, int fd_client)
{
ssize_t len, i, rc = 0;
/* Read input message */
- len = read(fd_client, conn->buf, conn->buf_size);
+ len = read(fd_client, c->buf, c->buf_size);
if (len == -1) {
if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
@@ -39,24 +39,24 @@ data_event_handle(struct conn *conn, int fd_client)
/* Handle input messages */
for (i = 0; i < len; i++) {
- if (conn->buf[i] == '\n') {
+ if (c->buf[i] == '\n') {
size_t n;
- conn->msg_in[conn->msg_in_len] = 0;
- conn->msg_out[0] = 0;
+ c->msg_in[c->msg_in_len] = 0;
+ c->msg_out[0] = 0;
- conn->msg_handle(conn->msg_in, conn->msg_out, conn->msg_out_len_max,
- conn->msg_handle_arg);
+ c->msg_handle(c->msg_in, c->msg_out, c->msg_out_len_max,
+ c->msg_handle_arg);
- n = strlen(conn->msg_out);
+ n = strlen(c->msg_out);
if (n) {
- rc = write(fd_client, conn->msg_out, n);
+ rc = write(fd_client, c->msg_out, n);
if (rc == -1)
goto exit;
}
- conn->msg_in_len = 0;
- } else if (conn->msg_in_len < conn->msg_in_len_max) {
- conn->msg_in[conn->msg_in_len] = conn->buf[i];
- conn->msg_in_len++;
+ c->msg_in_len = 0;
+ } else if (c->msg_in_len < c->msg_in_len_max) {
+ c->msg_in[c->msg_in_len] = c->buf[i];
+ c->msg_in_len++;
} else {
rc = write(fd_client, MSG_CMD_TOO_LONG, strlen(MSG_CMD_TOO_LONG));
@@ -64,10 +64,10 @@ data_event_handle(struct conn *conn, int fd_client)
goto exit;
- conn->msg_in_len = 0;
+ c->msg_in_len = 0;
}
}
/* Write prompt */
- rc = write(fd_client, conn->prompt, strlen(conn->prompt));
+ rc = write(fd_client, c->prompt, strlen(c->prompt));
rc = (rc == -1) ? -1 : 0;
@@ -77,9 +77,9 @@ exit:
static int
-control_event_handle(struct conn *conn, int fd_client)
+control_event_handle(struct conn *c, int fd_client)
{
int rc;
- rc = epoll_ctl(conn->fd_client_group, EPOLL_CTL_DEL, fd_client, NULL);
+ rc = epoll_ctl(c->fd_client_group, EPOLL_CTL_DEL, fd_client, NULL);
if (rc == -1)
goto exit;
@@ -100,5 +100,5 @@ conn_init(struct conn_params *p)
int fd_server, fd_client_group, rc;
struct sockaddr_in server_address;
- struct conn *conn = NULL;
+ struct conn *c = NULL;
int reuse = 1;
@@ -116,18 +116,18 @@ conn_init(struct conn_params *p)
/* Memory allocation */
- conn = calloc(1, sizeof(struct conn));
- if (conn == NULL)
+ c = calloc(1, sizeof(struct conn));
+ if (c == NULL)
goto exit;
- conn->welcome = calloc(1, CONN_WELCOME_LEN_MAX + 1);
- conn->prompt = calloc(1, CONN_PROMPT_LEN_MAX + 1);
- conn->buf = calloc(1, p->buf_size);
- conn->msg_in = calloc(1, p->msg_in_len_max + 1);
- conn->msg_out = calloc(1, p->msg_out_len_max + 1);
+ c->welcome = calloc(1, CONN_WELCOME_LEN_MAX + 1);
+ c->prompt = calloc(1, CONN_PROMPT_LEN_MAX + 1);
+ c->buf = calloc(1, p->buf_size);
+ c->msg_in = calloc(1, p->msg_in_len_max + 1);
+ c->msg_out = calloc(1, p->msg_out_len_max + 1);
- if ((conn->welcome == NULL) || (conn->prompt == NULL) || (conn->buf == NULL) ||
- (conn->msg_in == NULL) || (conn->msg_out == NULL)) {
- conn_free(conn);
- conn = NULL;
+ if ((c->welcome == NULL) || (c->prompt == NULL) || (c->buf == NULL) ||
+ (c->msg_in == NULL) || (c->msg_out == NULL)) {
+ conn_free(c);
+ c = NULL;
goto exit;
}
@@ -139,6 +139,6 @@ conn_init(struct conn_params *p)
fd_server = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
if (fd_server == -1) {
- conn_free(conn);
- conn = NULL;
+ conn_free(c);
+ c = NULL;
goto exit;
}
@@ -162,45 +162,45 @@ conn_init(struct conn_params *p)
/* Fill in */
- rte_strscpy(conn->welcome, p->welcome, CONN_WELCOME_LEN_MAX);
- rte_strscpy(conn->prompt, p->prompt, CONN_PROMPT_LEN_MAX);
- conn->buf_size = p->buf_size;
- conn->msg_in_len_max = p->msg_in_len_max;
- conn->msg_out_len_max = p->msg_out_len_max;
- conn->msg_in_len = 0;
- conn->fd_server = fd_server;
- conn->fd_client_group = fd_client_group;
- conn->msg_handle = p->msg_handle;
- conn->msg_handle_arg = p->msg_handle_arg;
+ rte_strscpy(c->welcome, p->welcome, CONN_WELCOME_LEN_MAX);
+ rte_strscpy(c->prompt, p->prompt, CONN_PROMPT_LEN_MAX);
+ c->buf_size = p->buf_size;
+ c->msg_in_len_max = p->msg_in_len_max;
+ c->msg_out_len_max = p->msg_out_len_max;
+ c->msg_in_len = 0;
+ c->fd_server = fd_server;
+ c->fd_client_group = fd_client_group;
+ c->msg_handle = p->msg_handle;
+ c->msg_handle_arg = p->msg_handle_arg;
exit:
- return conn;
+ return c;
free:
- conn_free(conn);
+ conn_free(c);
close(fd_server);
- conn = NULL;
- return conn;
+ c = NULL;
+ return c;
}
void
-conn_free(struct conn *conn)
+conn_free(struct conn *c)
{
- if (conn == NULL)
+ if (c == NULL)
return;
- if (conn->fd_client_group)
- close(conn->fd_client_group);
+ if (c->fd_client_group)
+ close(c->fd_client_group);
- if (conn->fd_server)
- close(conn->fd_server);
+ if (c->fd_server)
+ close(c->fd_server);
- free(conn->msg_out);
- free(conn->msg_in);
- free(conn->prompt);
- free(conn->welcome);
- free(conn);
+ free(c->msg_out);
+ free(c->msg_in);
+ free(c->prompt);
+ free(c->welcome);
+ free(c);
}
int
-conn_req_poll(struct conn *conn)
+conn_req_poll(struct conn *c)
{
struct sockaddr_in client_address;
@@ -210,10 +210,10 @@ conn_req_poll(struct conn *conn)
/* Check input arguments */
- if (conn == NULL)
+ if (c == NULL)
return -1;
/* Server socket */
client_address_length = sizeof(client_address);
- fd_client = accept4(conn->fd_server, (struct sockaddr *)&client_address,
+ fd_client = accept4(c->fd_server, (struct sockaddr *)&client_address,
&client_address_length, SOCK_NONBLOCK);
if (fd_client == -1) {
@@ -228,5 +228,5 @@ conn_req_poll(struct conn *conn)
event.data.fd = fd_client;
- rc = epoll_ctl(conn->fd_client_group, EPOLL_CTL_ADD, fd_client, &event);
+ rc = epoll_ctl(c->fd_client_group, EPOLL_CTL_ADD, fd_client, &event);
if (rc == -1) {
close(fd_client);
@@ -235,5 +235,5 @@ conn_req_poll(struct conn *conn)
/* Client */
- rc = write(fd_client, conn->welcome, strlen(conn->welcome));
+ rc = write(fd_client, c->welcome, strlen(c->welcome));
if (rc == -1) {
close(fd_client);
@@ -241,5 +241,5 @@ conn_req_poll(struct conn *conn)
}
- rc = write(fd_client, conn->prompt, strlen(conn->prompt));
+ rc = write(fd_client, c->prompt, strlen(c->prompt));
if (rc == -1) {
close(fd_client);
@@ -254,5 +254,5 @@ exit:
int
-conn_msg_poll(struct conn *conn)
+conn_msg_poll(struct conn *c)
{
int fd_client, rc, rc_data = 0, rc_control = 0;
@@ -260,9 +260,9 @@ conn_msg_poll(struct conn *conn)
/* Check input arguments */
- if (conn == NULL)
+ if (c == NULL)
return -1;
/* Client group */
- rc = epoll_wait(conn->fd_client_group, &event, 1, 0);
+ rc = epoll_wait(c->fd_client_group, &event, 1, 0);
if ((rc == -1) || rc == 0)
return rc;
@@ -272,9 +272,9 @@ conn_msg_poll(struct conn *conn)
/* Data available */
if (event.events & EPOLLIN)
- rc_data = data_event_handle(conn, fd_client);
+ rc_data = data_event_handle(c, fd_client);
/* Control events */
if (event.events & (EPOLLRDHUP | EPOLLERR | EPOLLHUP))
- rc_control = control_event_handle(conn, fd_client);
+ rc_control = control_event_handle(c, fd_client);
if (rc_data || rc_control)
--
2.53.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-02-26 10:16:47.966291279 +0000
+++ 0021-app-graph-fix-variable-shadowing.patch 2026-02-26 10:16:46.912467882 +0000
@@ -1 +1 @@
-From 7cf4b28a211dd832847130036cfc83a670990f9a Mon Sep 17 00:00:00 2001
+From 84011af88d7f051281d4adcf9b796245ed2f81af Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7cf4b28a211dd832847130036cfc83a670990f9a ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list