From: Wentao Liang <vulab@iscas.ac.cn>
To: mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc,
sven@narfation.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org
Cc: b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Wentao Liang <vulab@iscas.ac.cn>,
stable@vger.kernel.org
Subject: [PATCH] batman-adv: batman-adv: handle tvlv unicast send errors
Date: Tue, 1 Apr 2025 16:39:00 +0800 [thread overview]
Message-ID: <20250401083901.2261-1-vulab@iscas.ac.cn> (raw)
In batadv_tvlv_unicast_send(), the return value of
batadv_send_skb_to_orig() is ignored. This could silently
drop send failures, making it difficult to detect connectivity
issues.
Add error checking for batadv_send_skb_to_orig() and log failures
via batadv_dbg() to improve error visibility.
Fixes: 1ad5bcb2a032 ("batman-adv: Consume skb in batadv_send_skb_to_orig")
Cc: stable@vger.kernel.org # 4.10+
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
net/batman-adv/tvlv.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/batman-adv/tvlv.c b/net/batman-adv/tvlv.c
index 2a583215d439..f081136cc5b7 100644
--- a/net/batman-adv/tvlv.c
+++ b/net/batman-adv/tvlv.c
@@ -625,6 +625,7 @@ void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, const u8 *src,
unsigned char *tvlv_buff;
unsigned int tvlv_len;
ssize_t hdr_len = sizeof(*unicast_tvlv_packet);
+ int r;
orig_node = batadv_orig_hash_find(bat_priv, dst);
if (!orig_node)
@@ -657,7 +658,10 @@ void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, const u8 *src,
tvlv_buff += sizeof(*tvlv_hdr);
memcpy(tvlv_buff, tvlv_value, tvlv_value_len);
- batadv_send_skb_to_orig(skb, orig_node, NULL);
+ r = batadv_send_skb_to_orig(skb, orig_node, NULL);
+ if (r != NET_XMIT_SUCCESS)
+ batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
+ "Fail to send the ack.");
out:
batadv_orig_node_put(orig_node);
}
--
2.42.0.windows.2
next reply other threads:[~2025-04-01 8:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 8:39 Wentao Liang [this message]
2025-04-01 8:48 ` Sven Eckelmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250401083901.2261-1-vulab@iscas.ac.cn \
--to=vulab@iscas.ac.cn \
--cc=a@unstable.cc \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mareklindner@neomailbox.ch \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=sven@narfation.org \
--cc=sw@simonwunderlich.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®