summaryrefslogtreecommitdiff
path: root/net/handshake/netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/handshake/netlink.c')
-rw-r--r--net/handshake/netlink.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/handshake/netlink.c b/net/handshake/netlink.c
index 7264cac04047..8ea0ff993f9f 100644
--- a/net/handshake/netlink.c
+++ b/net/handshake/netlink.c
@@ -18,6 +18,8 @@
#include <net/genetlink.h>
#include <net/netns/generic.h>
+#include <kunit/visibility.h>
+
#include <uapi/linux/handshake.h>
#include "handshake.h"
#include "genl.h"
@@ -38,6 +40,10 @@ int handshake_genl_notify(struct net *net, const struct handshake_proto *proto,
struct sk_buff *msg;
void *hdr;
+ /* Disable notifications during unit testing */
+ if (!test_bit(HANDSHAKE_F_PROTO_NOTIFY, &proto->hp_flags))
+ return 0;
+
if (!genl_has_listeners(&handshake_nl_family, net,
proto->hp_handler_class))
return -ESRCH;
@@ -262,6 +268,7 @@ struct handshake_net *handshake_pernet(struct net *net)
return handshake_net_id ?
net_generic(net, handshake_net_id) : NULL;
}
+EXPORT_SYMBOL_IF_KUNIT(handshake_pernet);
static int __init handshake_init(void)
{