diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-07-27 11:44:59 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-07-27 11:44:59 +0200 |
commit | 115ac442812928e1ae0682aca5f1d0cbb77d92cf (patch) | |
tree | 1ea4ef8f850142bdcc6e2be9c570683c3f7273f6 | |
parent | 59341681d3dcc3e17105261425b5f08ab954a948 (diff) |
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 <tklauser@distanz.ch>
-rw-r--r-- | flowtop.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |