From 115ac442812928e1ae0682aca5f1d0cbb77d92cf Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 27 Jul 2015 11:44:59 +0200 Subject: flowtop: Make struct flow_entry member size checks build_bug_on() The city_{src,dst}, country_{src,dst} and rev_dns_{src,dst} members of struct flow_entry have their size defined at compile time, so perform the equal size checks at compile time as well. Signed-off-by: Tobias Klauser --- flowtop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'flowtop.c') diff --git a/flowtop.c b/flowtop.c index 9d935e1..6844402 100644 --- a/flowtop.c +++ b/flowtop.c @@ -571,7 +571,7 @@ flow_entry_geo_city_lookup_generic(struct flow_entry *n, break; } - bug_on(sizeof(n->city_src) != sizeof(n->city_dst)); + build_bug_on(sizeof(n->city_src) != sizeof(n->city_dst)); if (city) { memcpy(SELFLD(dir, city_src, city_dst), city, @@ -605,7 +605,7 @@ flow_entry_geo_country_lookup_generic(struct flow_entry *n, break; } - bug_on(sizeof(n->country_src) != sizeof(n->country_dst)); + build_bug_on(sizeof(n->country_src) != sizeof(n->country_dst)); if (country) { memcpy(SELFLD(dir, country_src, country_dst), country, @@ -651,7 +651,7 @@ static void flow_entry_get_extended_revdns(struct flow_entry *n, break; } - bug_on(sizeof(n->rev_dns_src) != sizeof(n->rev_dns_dst)); + build_bug_on(sizeof(n->rev_dns_src) != sizeof(n->rev_dns_dst)); getnameinfo(sa, sa_len, SELFLD(dir, rev_dns_src, rev_dns_dst), sizeof(n->rev_dns_src), NULL, 0, NI_NUMERICHOST); -- cgit v1.2.3-54-g00ecf