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:
parent
c8234ce878
commit
bf669ab2dd
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue