diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-12-11 05:12:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:57:07 -0500 |
commit | 1f9e636ea21bd648a5cbd2f744a1d39a5e183b20 (patch) | |
tree | 33d4c23d9c2a64ed042151f51962754af3359692 /net/ipv4/tcp.c | |
parent | ea72912c888661d1a847f1b1450643d4114097cf (diff) |
[TCP]: Use BUILD_BUG_ON for tcp_skb_cb size checking
The sizeof(struct tcp_skb_cb) should not be less than the
sizeof(skb->cb). This is checked in net/ipv4/tcp.c, but
this check can be made more gracefully.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index eb77088f3054..fdaf965a6794 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2563,7 +2563,6 @@ void tcp_done(struct sock *sk) | |||
2563 | } | 2563 | } |
2564 | EXPORT_SYMBOL_GPL(tcp_done); | 2564 | EXPORT_SYMBOL_GPL(tcp_done); |
2565 | 2565 | ||
2566 | extern void __skb_cb_too_small_for_tcp(int, int); | ||
2567 | extern struct tcp_congestion_ops tcp_reno; | 2566 | extern struct tcp_congestion_ops tcp_reno; |
2568 | 2567 | ||
2569 | static __initdata unsigned long thash_entries; | 2568 | static __initdata unsigned long thash_entries; |
@@ -2582,9 +2581,7 @@ void __init tcp_init(void) | |||
2582 | unsigned long limit; | 2581 | unsigned long limit; |
2583 | int order, i, max_share; | 2582 | int order, i, max_share; |
2584 | 2583 | ||
2585 | if (sizeof(struct tcp_skb_cb) > sizeof(skb->cb)) | 2584 | BUILD_BUG_ON(sizeof(struct tcp_skb_cb) > sizeof(skb->cb)); |
2586 | __skb_cb_too_small_for_tcp(sizeof(struct tcp_skb_cb), | ||
2587 | sizeof(skb->cb)); | ||
2588 | 2585 | ||
2589 | tcp_hashinfo.bind_bucket_cachep = | 2586 | tcp_hashinfo.bind_bucket_cachep = |
2590 | kmem_cache_create("tcp_bind_bucket", | 2587 | kmem_cache_create("tcp_bind_bucket", |