]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/netfilter/ip_tables.c
netfilter: x_tables: add and use xt_check_entry_offsets
[karo-tx-linux.git] / net / ipv4 / netfilter / ip_tables.c
index 503038ea7735b270f22232a013d230f98dbfe957..71c204d4ca5f80e8fc7f12686ecc27809315c941 100644 (file)
@@ -590,20 +590,10 @@ static void cleanup_match(struct xt_entry_match *m, struct net *net)
 static int
 check_entry(const struct ipt_entry *e)
 {
-       const struct xt_entry_target *t;
-
        if (!ip_checkentry(&e->ip))
                return -EINVAL;
 
-       if (e->target_offset + sizeof(struct xt_entry_target) >
-           e->next_offset)
-               return -EINVAL;
-
-       t = ipt_get_target_c(e);
-       if (e->target_offset + t->u.target_size > e->next_offset)
-               return -EINVAL;
-
-       return 0;
+       return xt_check_entry_offsets(e, e->target_offset, e->next_offset);
 }
 
 static int