[PATCH 08/31] net/udp sendmsg: do not return an error if dest addr is null

Jean-Baptiste Tr├ędez jean-baptiste.tredez at alstefgroup.com
Tue May 11 18:05:12 CEST 2021


From: Gilles Chanteperdrix <gilles.chanteperdrix at xenomai.org>

Signed-off-by: Philippe Gerum <rpm at xenomai.org>
---
 kernel/drivers/net/stack/ipv4/udp/udp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/drivers/net/stack/ipv4/udp/udp.c b/kernel/drivers/net/stack/ipv4/udp/udp.c
index beceb28cf..2ff2febda 100644
--- a/kernel/drivers/net/stack/ipv4/udp/udp.c
+++ b/kernel/drivers/net/stack/ipv4/udp/udp.c
@@ -687,6 +687,9 @@ ssize_t rt_udp_sendmsg(struct rtdm_fd *fd, const struct user_msghdr *msg,
 
 	rtdm_lock_put_irqrestore(&udp_socket_base_lock, context);
 
+	if (daddr == 0)
+		return 0;
+
 	if ((daddr | dport) == 0) {
 		err = -EINVAL;
 		goto out;
-- 
2.17.1




More information about the Xenomai mailing list