Commit e181a543 authored by Mathias Krause's avatar Mathias Krause Committed by David S. Miller

net: #ifdefify sk_classid member of struct sock

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: default avatarMathias Krause <minipli@googlemail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e69724f3
...@@ -429,7 +429,9 @@ struct sock { ...@@ -429,7 +429,9 @@ struct sock {
void *sk_security; void *sk_security;
#endif #endif
__u32 sk_mark; __u32 sk_mark;
#ifdef CONFIG_CGROUP_NET_CLASSID
u32 sk_classid; u32 sk_classid;
#endif
struct cg_proto *sk_cgrp; struct cg_proto *sk_cgrp;
void (*sk_state_change)(struct sock *sk); void (*sk_state_change)(struct sock *sk);
void (*sk_data_ready)(struct sock *sk); void (*sk_data_ready)(struct sock *sk);
......
...@@ -166,11 +166,13 @@ void nft_meta_get_eval(const struct nft_expr *expr, ...@@ -166,11 +166,13 @@ void nft_meta_get_eval(const struct nft_expr *expr,
goto err; goto err;
*dest = out->group; *dest = out->group;
break; break;
#ifdef CONFIG_CGROUP_NET_CLASSID
case NFT_META_CGROUP: case NFT_META_CGROUP:
if (skb->sk == NULL || !sk_fullsock(skb->sk)) if (skb->sk == NULL || !sk_fullsock(skb->sk))
goto err; goto err;
*dest = skb->sk->sk_classid; *dest = skb->sk->sk_classid;
break; break;
#endif
default: default:
WARN_ON(1); WARN_ON(1);
goto err; goto err;
...@@ -246,7 +248,9 @@ int nft_meta_get_init(const struct nft_ctx *ctx, ...@@ -246,7 +248,9 @@ int nft_meta_get_init(const struct nft_ctx *ctx,
case NFT_META_CPU: case NFT_META_CPU:
case NFT_META_IIFGROUP: case NFT_META_IIFGROUP:
case NFT_META_OIFGROUP: case NFT_META_OIFGROUP:
#ifdef CONFIG_CGROUP_NET_CLASSID
case NFT_META_CGROUP: case NFT_META_CGROUP:
#endif
len = sizeof(u32); len = sizeof(u32);
break; break;
case NFT_META_IIFNAME: case NFT_META_IIFNAME:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment