]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Import patch p_mipt
authornet[shemminger]!shemminger <net[shemminger]!shemminger>
Wed, 30 Mar 2005 18:19:55 +0000 (18:19 +0000)
committernet[shemminger]!shemminger <net[shemminger]!shemminger>
Wed, 30 Mar 2005 18:19:55 +0000 (18:19 +0000)
(Logical change 1.180)

tc/m_ipt.c

index 518e4a3cebb47ce379bbf1623e1c4fdf60f92725..1d375d31cdf385f817bbc3259142f53d2c27d631 100644 (file)
@@ -337,6 +337,17 @@ struct in_addr *dotted_to_addr(const char *dotted)
        return &addr;
 }
 
+static void set_revision(char *name, u_int8_t revision)
+{
+       /* Old kernel sources don't have ".revision" field,
+       *  but we stole a byte from name. */
+       name[IPT_FUNCTION_MAXNAMELEN - 2] = '\0';
+       name[IPT_FUNCTION_MAXNAMELEN - 1] = revision;
+}
+
+/* 
+ * we may need to check for version mismatch
+*/
 int
 build_st(struct iptables_target *target, struct ipt_entry_target *t)
 {
@@ -350,8 +361,11 @@ build_st(struct iptables_target *target, struct ipt_entry_target *t)
 
                if (NULL == t) {
                        target->t = fw_calloc(1, size);
-                       target->init(target->t, &nfcache);
                        target->t->u.target_size = size;
+
+                       if (target->init != NULL)
+                               target->init(target->t, &nfcache);
+                       set_revision(target->t->u.user.name, target->revision);
                } else {
                        target->t = t;
                }