All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] l2tp_netlink: ignore -ESRCH of genlmsg_multicast_allns()
@ 2016-02-21 20:58 Alexander Couzens
  2016-02-22 13:41 ` Alexander Couzens
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Couzens @ 2016-02-21 20:58 UTC (permalink / raw)
  To: netdev; +Cc: Alexander Couzens

If no one registered to the l2tp netlink group, genlmsg_multicast_allns
returns -ESRCH. Ignore return code -ESRCH of genlmsg_mulitcast_allns
within tunnel_create and session_create calls.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
---
 net/l2tp/l2tp_netlink.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index f93c5be..eced13a 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -123,11 +123,15 @@ static int l2tp_tunnel_notify(struct genl_family *family,
 
 	ret = l2tp_nl_tunnel_send(msg, info->snd_portid, info->snd_seq,
 				  NLM_F_ACK, tunnel, cmd);
+	if (ret < 0) {
+		nlmsg_free(msg);
+		return ret;
+	}
 
-	if (ret >= 0)
-		return genlmsg_multicast_allns(family, msg, 0,	0, GFP_ATOMIC);
-
-	nlmsg_free(msg);
+	ret = genlmsg_multicast_allns(family, msg, 0, 0, GFP_ATOMIC);
+	/* We don't care if no one is listening */
+	if (ret == -ESRCH)
+		ret = 0;
 
 	return ret;
 }
@@ -146,11 +150,15 @@ static int l2tp_session_notify(struct genl_family *family,
 
 	ret = l2tp_nl_session_send(msg, info->snd_portid, info->snd_seq,
 				   NLM_F_ACK, session, cmd);
+	if (ret < 0) {
+		nlmsg_free(msg);
+		return ret;
+	}
 
-	if (ret >= 0)
-		return genlmsg_multicast_allns(family, msg, 0,	0, GFP_ATOMIC);
-
-	nlmsg_free(msg);
+	ret = genlmsg_multicast_allns(family, msg, 0, 0, GFP_ATOMIC);
+	/* We don't care if no one is listening */
+	if (ret == -ESRCH)
+		ret = 0;
 
 	return ret;
 }
-- 
2.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] l2tp_netlink: ignore -ESRCH of genlmsg_multicast_allns()
  2016-02-21 20:58 [PATCH] l2tp_netlink: ignore -ESRCH of genlmsg_multicast_allns() Alexander Couzens
@ 2016-02-22 13:41 ` Alexander Couzens
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Couzens @ 2016-02-22 13:41 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

Sorry for the noise. I only looked into the git tree net-next for
changes of the l2tp module and not lately on the mailinglist.

Best,
lynxis
-- 
Alexander Couzens

mail: lynxis@fe80.eu
jabber: lynxis@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-22 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-21 20:58 [PATCH] l2tp_netlink: ignore -ESRCH of genlmsg_multicast_allns() Alexander Couzens
2016-02-22 13:41 ` Alexander Couzens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.