dnsmasq: move feature detection inside a shell func
[openwrt/openwrt.git] / target / linux / generic / hack-4.9 / 901-debloat_sock_diag.patch
index 98ac5afea646eb0d7daf5ffc6afe6b2fb626ca2b..1d33ab3e6fd9597c5f3c3df6e98baf35fc3df31b 100644 (file)
@@ -41,12 +41,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  obj-$(CONFIG_PROC_FS) += net-procfs.o
 --- a/net/core/sock.c
 +++ b/net/core/sock.c
-@@ -1457,9 +1457,11 @@ void sk_destruct(struct sock *sk)
+@@ -1458,9 +1458,11 @@ void sk_destruct(struct sock *sk)
  
  static void __sk_free(struct sock *sk)
  {
 +#ifdef CONFIG_SOCK_DIAG
-       if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt))
+       if (unlikely(sk->sk_net_refcnt && sock_diag_has_destroy_listeners(sk)))
                sock_diag_broadcast_destroy(sk);
        else
 +#endif