From 5b2cb97c06029c3393b991f61af17dab49f663cd Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 13 May 2010 15:58:50 +0200 Subject: [PATCH] compat_xtables: annotate struct xtnu_{match,target}->name --- extensions/compat_xtnu.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/compat_xtnu.h b/extensions/compat_xtnu.h index 71c7407..895e3d6 100644 --- a/extensions/compat_xtnu.h +++ b/extensions/compat_xtnu.h @@ -83,7 +83,11 @@ struct xt_tgdtor_param { struct xtnu_match { struct list_head list; - char name[XT_FUNCTION_MAXNAMELEN - 1 - sizeof(void *)]; + /* + * Making it smaller by sizeof(void *) on purpose to catch + * lossy translation, if any. + */ + char name[sizeof(((struct xt_match *)NULL)->name) - 1 - sizeof(void *)]; uint8_t revision; bool (*match)(const struct sk_buff *, const struct xt_match_param *); int (*checkentry)(const struct xt_mtchk_param *); @@ -98,7 +102,7 @@ struct xtnu_match { struct xtnu_target { struct list_head list; - char name[XT_FUNCTION_MAXNAMELEN - 1 - sizeof(void *)]; + char name[sizeof(((struct xt_target *)NULL)->name) - 1 - sizeof(void *)]; uint8_t revision; unsigned int (*target)(struct sk_buff **, const struct xt_target_param *);