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>
This commit is contained in:
Harout Hedeshian 2015-03-06 15:29:18 -08:00 committed by Gerrit - the friendly Code Review server
parent 2ff0185eb2
commit 784cd745bd
1 changed files with 4 additions and 1 deletions

View File

@ -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;