The size is verified by x_tables and isn't needed by the modules anymore.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
                          const void *ip,
                          const struct xt_match *match,
                          void *matchinfo,
-                         unsigned int matchinfosize,
                          unsigned int hook_mask);
 
        /* Called when entry of this type deleted. */
-       void (*destroy)(const struct xt_match *match, void *matchinfo,
-                       unsigned int matchinfosize);
+       void (*destroy)(const struct xt_match *match, void *matchinfo);
 
        /* Called when userspace align differs from kernel space one */
        int (*compat)(void *match, void **dstptr, int *size, int convert);
                          const void *entry,
                          const struct xt_target *target,
                          void *targinfo,
-                         unsigned int targinfosize,
                          unsigned int hook_mask);
 
        /* Called when entry of this type deleted. */
-       void (*destroy)(const struct xt_target *target, void *targinfo,
-                       unsigned int targinfosize);
+       void (*destroy)(const struct xt_target *target, void *targinfo);
 
        /* Called when userspace align differs from kernel space one */
        int (*compat)(void *target, void **dstptr, int *size, int convert);
 
                }
        } else if (t->u.kernel.target->checkentry
                   && !t->u.kernel.target->checkentry(name, e, target, t->data,
-                                                     t->u.target_size
-                                                     - sizeof(*t),
                                                      e->comefrom)) {
                duprintf("arp_tables: check failed for `%s'.\n",
                         t->u.kernel.target->name);
 
        t = arpt_get_target(e);
        if (t->u.kernel.target->destroy)
-               t->u.kernel.target->destroy(t->u.kernel.target, t->data,
-                                           t->u.target_size - sizeof(*t));
+               t->u.kernel.target->destroy(t->u.kernel.target, t->data);
        module_put(t->u.kernel.target->me);
        return 0;
 }
 
 
 static int
 checkentry(const char *tablename, const void *e, const struct xt_target *target,
-           void *targinfo, unsigned int targinfosize, unsigned int hook_mask)
+           void *targinfo, unsigned int hook_mask)
 {
        const struct arpt_mangle *mangle = targinfo;
 
 
                               const void *entry,
                               const struct ipt_target *target,
                               void *targinfo,
-                              unsigned int targinfosize,
                               unsigned int hook_mask)
 {
        struct ip_nat_multi_range_compat *mr = targinfo;
                               const void *entry,
                               const struct ipt_target *target,
                               void *targinfo,
-                              unsigned int targinfosize,
                               unsigned int hook_mask)
 {
        struct ip_nat_multi_range_compat *mr = targinfo;
 
                return 1;
 
        if (m->u.kernel.match->destroy)
-               m->u.kernel.match->destroy(m->u.kernel.match, m->data,
-                                          m->u.match_size - sizeof(*m));
+               m->u.kernel.match->destroy(m->u.kernel.match, m->data);
        module_put(m->u.kernel.match->me);
        return 0;
 }
 
        if (m->u.kernel.match->checkentry
            && !m->u.kernel.match->checkentry(name, ip, match, m->data,
-                                             m->u.match_size - sizeof(*m),
                                              hookmask)) {
                duprintf("ip_tables: check failed for `%s'.\n",
                         m->u.kernel.match->name);
                }
        } else if (t->u.kernel.target->checkentry
                   && !t->u.kernel.target->checkentry(name, e, target, t->data,
-                                                     t->u.target_size
-                                                     - sizeof(*t),
                                                      e->comefrom)) {
                duprintf("ip_tables: check failed for `%s'.\n",
                         t->u.kernel.target->name);
        IPT_MATCH_ITERATE(e, cleanup_match, NULL);
        t = ipt_get_target(e);
        if (t->u.kernel.target->destroy)
-               t->u.kernel.target->destroy(t->u.kernel.target, t->data,
-                                           t->u.target_size - sizeof(*t));
+               t->u.kernel.target->destroy(t->u.kernel.target, t->data);
        module_put(t->u.kernel.target->me);
        return 0;
 }
 
        if (m->u.kernel.match->checkentry
            && !m->u.kernel.match->checkentry(name, ip, match, dm->data,
-                                             dm->u.match_size - sizeof(*dm),
                                              hookmask)) {
                duprintf("ip_tables: check failed for `%s'.\n",
                         m->u.kernel.match->name);
                        goto out;
        } else if (t->u.kernel.target->checkentry
                   && !t->u.kernel.target->checkentry(name, de, target,
-                               t->data, t->u.target_size - sizeof(*t),
-                               de->comefrom)) {
+                                                     t->data, de->comefrom)) {
                duprintf("ip_tables: compat: check failed for `%s'.\n",
                         t->u.kernel.target->name);
                goto out;
           const void *info,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchsize,
           unsigned int hook_mask)
 {
        const struct ipt_icmp *icmpinfo = matchinfo;
 
           const void *e_void,
           const struct xt_target *target,
            void *targinfo,
-           unsigned int targinfosize,
            unsigned int hook_mask)
 {
        struct ipt_clusterip_tgt_info *cipinfo = targinfo;
 }
 
 /* drop reference count of cluster config when rule is deleted */
-static void destroy(const struct xt_target *target, void *targinfo,
-                   unsigned int targinfosize)
+static void destroy(const struct xt_target *target, void *targinfo)
 {
        struct ipt_clusterip_tgt_info *cipinfo = targinfo;
 
 
           const void *e_void,
           const struct xt_target *target,
            void *targinfo,
-           unsigned int targinfosize,
            unsigned int hook_mask)
 {
        const struct ipt_ECN_info *einfo = (struct ipt_ECN_info *)targinfo;
 
                              const void *e,
                              const struct xt_target *target,
                              void *targinfo,
-                             unsigned int targinfosize,
                              unsigned int hook_mask)
 {
        const struct ipt_log_info *loginfo = targinfo;
 
                 const void *e,
                 const struct xt_target *target,
                 void *targinfo,
-                unsigned int targinfosize,
                 unsigned int hook_mask)
 {
        const struct ip_nat_multi_range_compat *mr = targinfo;
 
       const void *e,
       const struct xt_target *target,
       void *targinfo,
-      unsigned int targinfosize,
       unsigned int hook_mask)
 {
        const struct ip_nat_multi_range_compat *mr = targinfo;
 
               const void *e,
               const struct xt_target *target,
               void *targinfo,
-              unsigned int targinfosize,
               unsigned int hook_mask)
 {
        const struct ip_nat_multi_range_compat *mr = targinfo;
 
                 const void *e_void,
                 const struct xt_target *target,
                 void *targinfo,
-                unsigned int targinfosize,
                 unsigned int hook_mask)
 {
        const struct ipt_reject_info *rejinfo = targinfo;
 
              const void *e,
              const struct xt_target *target,
              void *targinfo,
-             unsigned int targinfosize,
              unsigned int hook_mask)
 {
        unsigned int count, countess, rangeip, index = 0;
 }
 
 static void 
-same_destroy(const struct xt_target *target, void *targinfo,
-               unsigned int targinfosize)
+same_destroy(const struct xt_target *target, void *targinfo)
 {
        struct ipt_same_info *mr = targinfo;
 
 
                      const void *e_void,
                      const struct xt_target *target,
                      void *targinfo,
-                     unsigned int targinfosize,
                      unsigned int hook_mask)
 {
        const struct ipt_tcpmss_info *tcpmssinfo = targinfo;
 
           const void *e_void,
           const struct xt_target *target,
            void *targinfo,
-           unsigned int targinfosize,
            unsigned int hook_mask)
 {
        const u_int8_t tos = ((struct ipt_tos_target_info *)targinfo)->tos;
 
                const void *e,
                const struct xt_target *target,
                void *targinfo,
-               unsigned int targinfosize,
                unsigned int hook_mask)
 {
        struct ipt_TTL_info *info = targinfo;
 
                               const void *e,
                               const struct xt_target *target,
                               void *targinfo,
-                              unsigned int targinfosize,
                               unsigned int hookmask)
 {
        struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) targinfo;
 
           const void *ip_void,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchinfosize,
           unsigned int hook_mask)
 {
        const struct ipt_ah *ahinfo = matchinfo;
 
 
 static int checkentry(const char *tablename, const void *ip_void,
                      const struct xt_match *match,
-                     void *matchinfo, unsigned int matchsize,
-                     unsigned int hook_mask)
+                     void *matchinfo, unsigned int hook_mask)
 {
        const struct ipt_ecn_info *info = matchinfo;
        const struct ipt_ip *ip = ip_void;
 
                     const void *inf,
                     const struct xt_match *match,
                     void *matchinfo,
-                    unsigned int matchsize,
                     unsigned int hook_mask)
 {
        struct ipt_hashlimit_info *r = matchinfo;
 }
 
 static void
-hashlimit_destroy(const struct xt_match *match, void *matchinfo,
-                 unsigned int matchsize)
+hashlimit_destroy(const struct xt_match *match, void *matchinfo)
 {
        struct ipt_hashlimit_info *r = matchinfo;
 
 
            const void *ip,
           const struct xt_match *match,
            void *matchinfo,
-           unsigned int matchsize,
            unsigned int hook_mask)
 {
        const struct ipt_owner_info *info = matchinfo;
 
 static int
 ipt_recent_checkentry(const char *tablename, const void *ip,
                      const struct xt_match *match, void *matchinfo,
-                     unsigned int matchsize, unsigned int hook_mask)
+                     unsigned int hook_mask)
 {
        const struct ipt_recent_info *info = matchinfo;
        struct recent_table *t;
 }
 
 static void
-ipt_recent_destroy(const struct xt_match *match, void *matchinfo,
-                  unsigned int matchsize)
+ipt_recent_destroy(const struct xt_match *match, void *matchinfo)
 {
        const struct ipt_recent_info *info = matchinfo;
        struct recent_table *t;
 
                return 1;
 
        if (m->u.kernel.match->destroy)
-               m->u.kernel.match->destroy(m->u.kernel.match, m->data,
-                                          m->u.match_size - sizeof(*m));
+               m->u.kernel.match->destroy(m->u.kernel.match, m->data);
        module_put(m->u.kernel.match->me);
        return 0;
 }
 
        if (m->u.kernel.match->checkentry
            && !m->u.kernel.match->checkentry(name, ipv6, match,  m->data,
-                                             m->u.match_size - sizeof(*m),
                                              hookmask)) {
                duprintf("ip_tables: check failed for `%s'.\n",
                         m->u.kernel.match->name);
                }
        } else if (t->u.kernel.target->checkentry
                   && !t->u.kernel.target->checkentry(name, e, target, t->data,
-                                                     t->u.target_size
-                                                     - sizeof(*t),
                                                      e->comefrom)) {
                duprintf("ip_tables: check failed for `%s'.\n",
                         t->u.kernel.target->name);
        IP6T_MATCH_ITERATE(e, cleanup_match, NULL);
        t = ip6t_get_target(e);
        if (t->u.kernel.target->destroy)
-               t->u.kernel.target->destroy(t->u.kernel.target, t->data,
-                                           t->u.target_size - sizeof(*t));
+               t->u.kernel.target->destroy(t->u.kernel.target, t->data);
        module_put(t->u.kernel.target->me);
        return 0;
 }
           const void *entry,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchsize,
           unsigned int hook_mask)
 {
        const struct ip6t_icmp *icmpinfo = matchinfo;
 
                const void *entry,
                const struct xt_target *target,
                void *targinfo,
-               unsigned int targinfosize,
                unsigned int hook_mask)
 {
        struct ip6t_HL_info *info = targinfo;
 
                               const void *entry,
                               const struct xt_target *target,
                               void *targinfo,
-                              unsigned int targinfosize,
                               unsigned int hook_mask)
 {
        const struct ip6t_log_info *loginfo = targinfo;
 
                 const void *entry,
                 const struct xt_target *target,
                 void *targinfo,
-                unsigned int targinfosize,
                 unsigned int hook_mask)
 {
        const struct ip6t_reject_info *rejinfo = targinfo;
 
           const void *entry,
          const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchinfosize,
           unsigned int hook_mask)
 {
        const struct ip6t_ah *ahinfo = matchinfo;
 
           const void *info,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchinfosize,
           unsigned int hook_mask)
 {
        const struct ip6t_opts *optsinfo = matchinfo;
 
           const void *ip,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchinfosize,
           unsigned int hook_mask)
 {
        const struct ip6t_frag *fraginfo = matchinfo;
 
           const void *entry,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchinfosize,
           unsigned int hook_mask)
 {
        const struct ip6t_opts *optsinfo = matchinfo;
 
                      const void *ip,
                      const struct xt_match *match,
                      void *matchinfo,
-                     unsigned int matchsize,
                      unsigned int hook_mask)
 {
        const struct ip6t_ipv6header_info *info = matchinfo;
 
           const void *ip,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchsize,
           unsigned int hook_mask)
 {
        const struct ip6t_owner_info *info = matchinfo;
 
           const void *entry,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchinfosize,
           unsigned int hook_mask)
 {
        const struct ip6t_rt *rtinfo = matchinfo;
 
           const void *entry,
           const struct xt_target *target,
           void *targinfo,
-          unsigned int targinfosize,
           unsigned int hook_mask)
 {
        struct xt_connmark_target_info *matchinfo = targinfo;
 
 
 static int checkentry(const char *tablename, const void *entry,
                      const struct xt_target *target, void *targinfo,
-                     unsigned int targinfosize, unsigned int hook_mask)
+                     unsigned int hook_mask)
 {
        struct xt_connsecmark_target_info *info = targinfo;
 
 
                      const void *e_void,
                      const struct xt_target *target,
                      void *targinfo,
-                     unsigned int targinfosize,
                      unsigned int hook_mask)
 {
        const u_int8_t dscp = ((struct xt_DSCP_info *)targinfo)->dscp;
 
              const void *entry,
              const struct xt_target *target,
              void *targinfo,
-             unsigned int targinfosize,
              unsigned int hook_mask)
 {
        struct xt_mark_target_info *markinfo = targinfo;
              const void *entry,
              const struct xt_target *target,
              void *targinfo,
-             unsigned int targinfosize,
              unsigned int hook_mask)
 {
        struct xt_mark_target_info_v1 *markinfo = targinfo;
 
 
 static int checkentry(const char *tablename, const void *entry,
                      const struct xt_target *target, void *targinfo,
-                     unsigned int targinfosize, unsigned int hook_mask)
+                     unsigned int hook_mask)
 {
        struct xt_secmark_target_info *info = targinfo;
 
 
                 const void *ip,
                 const struct xt_match *match,
                 void *matchinfo,
-                unsigned int matchsize,
                 unsigned int hook_mask)
 {
        const struct xt_connbytes_info *sinfo = matchinfo;
 
           const void *ip,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchsize,
           unsigned int hook_mask)
 {
        struct xt_connmark_info *cm = matchinfo;
 }
 
 static void
-destroy(const struct xt_match *match, void *matchinfo, unsigned int matchsize)
+destroy(const struct xt_match *match, void *matchinfo)
 {
 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
        nf_ct_l3proto_module_put(match->family);
 
           const void *ip,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchsize,
           unsigned int hook_mask)
 {
 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
 }
 
 static void
-destroy(const struct xt_match *match, void *matchinfo, unsigned int matchsize)
+destroy(const struct xt_match *match, void *matchinfo)
 {
 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
        nf_ct_l3proto_module_put(match->family);
 
           const void *inf,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchsize,
           unsigned int hook_mask)
 {
        const struct xt_dccp_info *info = matchinfo;
 
                      const void *info,
                      const struct xt_match *match,
                      void *matchinfo,
-                     unsigned int matchsize,
                      unsigned int hook_mask)
 {
        const u_int8_t dscp = ((struct xt_dscp_info *)matchinfo)->dscp;
 
           const void *ip_void,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchinfosize,
           unsigned int hook_mask)
 {
        const struct xt_esp *espinfo = matchinfo;
 
                 const void *inf,
                 const struct xt_match *match,
                 void *matchinfo,
-                unsigned int matchsize,
                 unsigned int hook_mask)
 {
        struct xt_helper_info *info = matchinfo;
 }
 
 static void
-destroy(const struct xt_match *match, void *matchinfo, unsigned int matchsize)
+destroy(const struct xt_match *match, void *matchinfo)
 {
 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
        nf_ct_l3proto_module_put(match->family);
 
                     const void *inf,
                     const struct xt_match *match,
                     void *matchinfo,
-                    unsigned int matchsize,
                     unsigned int hook_mask)
 {
        struct xt_rateinfo *r = matchinfo;
 
            const void *entry,
           const struct xt_match *match,
            void *matchinfo,
-           unsigned int matchsize,
            unsigned int hook_mask)
 {
        const struct xt_mark_info *minfo = matchinfo;
 
           const void *info,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchsize,
           unsigned int hook_mask)
 {
        const struct ipt_ip *ip = info;
              const void *info,
              const struct xt_match *match,
              void *matchinfo,
-             unsigned int matchsize,
              unsigned int hook_mask)
 {
        const struct ipt_ip *ip = info;
            const void *info,
            const struct xt_match *match,
            void *matchinfo,
-           unsigned int matchsize,
            unsigned int hook_mask)
 {
        const struct ip6t_ip6 *ip = info;
               const void *info,
               const struct xt_match *match,
               void *matchinfo,
-              unsigned int matchsize,
               unsigned int hook_mask)
 {
        const struct ip6t_ip6 *ip = info;
 
                       const void *ip,
                       const struct xt_match *match,
                       void *matchinfo,
-                      unsigned int matchsize,
                       unsigned int hook_mask)
 {
        const struct xt_physdev_info *info = matchinfo;
 
 
 static int checkentry(const char *tablename, const void *ip_void,
                       const struct xt_match *match,
-                      void *matchinfo, unsigned int matchsize,
-                      unsigned int hook_mask)
+                      void *matchinfo, unsigned int hook_mask)
 {
        struct xt_policy_info *info = matchinfo;
 
 
 static int
 checkentry(const char *tablename, const void *entry,
           const struct xt_match *match, void *matchinfo,
-          unsigned int matchsize, unsigned int hook_mask)
+          unsigned int hook_mask)
 {
        struct xt_quota_info *q = (struct xt_quota_info *)matchinfo;
 
 
           const void *inf,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchsize,
           unsigned int hook_mask)
 {
        const struct xt_sctp_info *info = matchinfo;
 
                 const void *inf,
                 const struct xt_match *match,
                 void *matchinfo,
-                unsigned int matchsize,
                 unsigned int hook_mask)
 {
 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
 }
 
 static void
-destroy(const struct xt_match *match, void *matchinfo, unsigned int matchsize)
+destroy(const struct xt_match *match, void *matchinfo)
 {
 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
        nf_ct_l3proto_module_put(match->family);
 
 static int
 checkentry(const char *tablename, const void *entry,
           const struct xt_match *match, void *matchinfo,
-          unsigned int matchsize, unsigned int hook_mask)
+          unsigned int hook_mask)
 {
        struct xt_statistic_info *info = (struct xt_statistic_info *)matchinfo;
 
 
                      const void *ip,
                      const struct xt_match *match,
                      void *matchinfo,
-                     unsigned int matchsize,
                      unsigned int hook_mask)
 {
        struct xt_string_info *conf = matchinfo;
        return 1;
 }
 
-static void destroy(const struct xt_match *match, void *matchinfo,
-                   unsigned int matchsize)
+static void destroy(const struct xt_match *match, void *matchinfo)
 {
        textsearch_destroy(STRING_TEXT_PRIV(matchinfo)->config);
 }
 
               const void *info,
               const struct xt_match *match,
               void *matchinfo,
-              unsigned int matchsize,
               unsigned int hook_mask)
 {
        const struct xt_tcp *tcpinfo = matchinfo;
               const void *info,
               const struct xt_match *match,
               void *matchinfo,
-              unsigned int matchsize,
               unsigned int hook_mask)
 {
        const struct xt_tcp *udpinfo = matchinfo;
 
        if (t->u.kernel.target->checkentry
            && !t->u.kernel.target->checkentry(table, NULL,
                                               t->u.kernel.target, t->data,
-                                              t->u.target_size - sizeof(*t),
                                               hook)) {
                module_put(t->u.kernel.target->me);
                ret = -EINVAL;
 static void ipt_destroy_target(struct ipt_entry_target *t)
 {
        if (t->u.kernel.target->destroy)
-               t->u.kernel.target->destroy(t->u.kernel.target, t->data,
-                                           t->u.target_size - sizeof(*t));
+               t->u.kernel.target->destroy(t->u.kernel.target, t->data);
         module_put(t->u.kernel.target->me);
 }