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

Philippe Gerum rpm at xenomai.org
Thu Mar 21 18:13:21 CET 2019


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 8539fe87a..57b642e5c 100644
--- a/kernel/drivers/net/stack/ipv4/udp/udp.c
+++ b/kernel/drivers/net/stack/ipv4/udp/udp.c
@@ -701,6 +701,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.20.1




More information about the Xenomai mailing list