From: Michael Benedict Date: Wed, 6 Jun 2018 15:54:25 +0000 (+1000) Subject: net: ipv4: only use when knox_ncm is enabled X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb1cc031fc2afd50ad751e96fe9ea5a0c822fba6;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git net: ipv4: only use when knox_ncm is enabled Signed-off-by: Michael Benedict --- diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 26cab1c3b6ff..ced5199416f9 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -422,6 +422,7 @@ out_rcu_unlock: goto out; } +#ifdef CONFIG_KNOX_NCM /* START_OF_KNOX_NPA */ /** The function is used to check if the ncm feature is enabled or not; if enabled then it calls knox_collect_socket_data function in ncm.c to record all the socket data; **/ static void knox_collect_metadata(struct socket *sock) { @@ -430,6 +431,7 @@ static void knox_collect_metadata(struct socket *sock) { } } /* END_OF_KNOX_NPA */ +#endif /* * The peer socket should always be NULL (or else). When we call this @@ -460,9 +462,11 @@ int inet_release(struct socket *sock) if (sock_flag(sk, SOCK_LINGER) && !(current->flags & PF_EXITING)) timeout = sk->sk_lingertime; +#ifdef CONFIG_KNOX_NCM /* START_OF_KNOX_NPA */ knox_collect_metadata(sock); /* END_OF_KNOX_NPA */ +#endif sock->sk = NULL; sk->sk_prot->close(sk, timeout); }