Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f74ecd7 authored by Richard Guy Briggs's avatar Richard Guy Briggs Committed by David S. Miller
Browse files

audit: send multicast messages only if there are listeners



Test first to see if there are any userspace multicast listeners bound to the
socket before starting the multicast send work.

Signed-off-by: default avatarRichard Guy Briggs <rgb@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 451f9216
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -435,6 +435,9 @@ static void kauditd_send_multicast_skb(struct sk_buff *skb)
	struct audit_net	*aunet = net_generic(&init_net, audit_net_id);
	struct sock		*sock = aunet->nlsk;

	if (!netlink_has_listeners(sock, AUDIT_NLGRP_READLOG))
		return;

	/*
	 * The seemingly wasteful skb_copy() rather than bumping the refcount
	 * using skb_get() is necessary because non-standard mods are made to