mirror of
https://github.com/sheumann/hush.git
synced 2025-03-04 01:30:00 +00:00
tc: less ugly check for bad sizeof(G)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
f133471302
commit
77350aa933
@ -43,17 +43,15 @@ struct globals {
|
|||||||
__u32 filter_proto;
|
__u32 filter_proto;
|
||||||
} FIX_ALIASING;
|
} FIX_ALIASING;
|
||||||
#define G (*(struct globals*)&bb_common_bufsiz1)
|
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||||
|
struct BUG_G_too_big {
|
||||||
|
char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
|
||||||
|
};
|
||||||
#define filter_ifindex (G.filter_ifindex)
|
#define filter_ifindex (G.filter_ifindex)
|
||||||
#define filter_qdisc (G.filter_qdisc)
|
#define filter_qdisc (G.filter_qdisc)
|
||||||
#define filter_parent (G.filter_parent)
|
#define filter_parent (G.filter_parent)
|
||||||
#define filter_prio (G.filter_prio)
|
#define filter_prio (G.filter_prio)
|
||||||
#define filter_proto (G.filter_proto)
|
#define filter_proto (G.filter_proto)
|
||||||
|
#define INIT_G() do { } while (0)
|
||||||
void BUG_tc_globals_too_big(void);
|
|
||||||
#define INIT_G() do { \
|
|
||||||
if (sizeof(G) > COMMON_BUFSIZE) \
|
|
||||||
BUG_tc_globals_too_big(); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
/* Allocates a buffer containing the name of a class id.
|
/* Allocates a buffer containing the name of a class id.
|
||||||
* The caller must free the returned memory. */
|
* The caller must free the returned memory. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user