summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHarout Hedeshian <harouth@codeaurora.org>2015-03-06 15:29:18 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:09:40 -0700
commitbf669ab2dd79566504cdc492a7cae988b897ba05 (patch)
treed40e42d5af8fcbdaacbd7aa1def43457ac51e054 /net
parentc8234ce878d15af361e30be075f1f504167128db (diff)
net: sockev: filtering non INET socket events
Too many socket events are generated by netlink socket. Filtering out unwanted socket events. Change-Id: I3a4d7e14843cf72d6af2d948113b27928ed01adb Acked-by: Krishnan Ramachandran <kramacha@qti.qualcomm.com> Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/sockev_nlmcast.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/core/sockev_nlmcast.c b/net/core/sockev_nlmcast.c
index 0b934d578d0b..7741f1f107cd 100644
--- a/net/core/sockev_nlmcast.c
+++ b/net/core/sockev_nlmcast.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -75,6 +75,9 @@ static int sockev_client_cb(struct notifier_block *nb,
if ((socknlmsgsk == NULL) || (sock == NULL) || (sock->sk == NULL))
goto done;
+ if (sock->sk->sk_family != AF_INET || sock->sk->sk_family != AF_INET6)
+ goto done;
+
skb = nlmsg_new(sizeof(struct sknlsockevmsg), GFP_KERNEL);
if (skb == NULL)
goto done;