net: #ifdefify sk_classid member of struct sock
authorMathias Krause <minipli@googlemail.com>
Sun, 19 Jul 2015 20:21:13 +0000 (22:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2015 23:04:30 +0000 (16:04 -0700)
The sk_classid member is only required when CONFIG_CGROUP_NET_CLASSID is
enabled. #ifdefify it to reduce the size of struct sock on 32 bit
systems, at least.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/netfilter/nft_meta.c

index 05a8c1aea25187c1692efcb1e350bb2c7f75a30b..4353ef70bf4826498c1fa0f7386c7f85134eb481 100644 (file)
@@ -429,7 +429,9 @@ struct sock {
        void                    *sk_security;
 #endif
        __u32                   sk_mark;
+#ifdef CONFIG_CGROUP_NET_CLASSID
        u32                     sk_classid;
+#endif
        struct cg_proto         *sk_cgrp;
        void                    (*sk_state_change)(struct sock *sk);
        void                    (*sk_data_ready)(struct sock *sk);
index 52561e1c31e26933dd654f095663c0f0a633f007..cb2f13ebb5a66cdf5fd9498ddfe8949f38741803 100644 (file)
@@ -166,11 +166,13 @@ void nft_meta_get_eval(const struct nft_expr *expr,
                        goto err;
                *dest = out->group;
                break;
+#ifdef CONFIG_CGROUP_NET_CLASSID
        case NFT_META_CGROUP:
                if (skb->sk == NULL || !sk_fullsock(skb->sk))
                        goto err;
                *dest = skb->sk->sk_classid;
                break;
+#endif
        default:
                WARN_ON(1);
                goto err;
@@ -246,7 +248,9 @@ int nft_meta_get_init(const struct nft_ctx *ctx,
        case NFT_META_CPU:
        case NFT_META_IIFGROUP:
        case NFT_META_OIFGROUP:
+#ifdef CONFIG_CGROUP_NET_CLASSID
        case NFT_META_CGROUP:
+#endif
                len = sizeof(u32);
                break;
        case NFT_META_IIFNAME: