]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
netfilter: xtables: constify args in compat copying functions
authorJan Engelhardt <jengelh@medozas.de>
Fri, 26 Jun 2009 06:23:19 +0000 (08:23 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Mon, 15 Feb 2010 15:59:28 +0000 (16:59 +0100)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
include/linux/netfilter/x_tables.h
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ipt_ULOG.c
net/ipv6/netfilter/ip6_tables.c
net/netfilter/x_tables.c
net/netfilter/xt_hashlimit.c
net/netfilter/xt_limit.c

index a0a144a6c6d939f50685350020799e785b21546e..c61758f4be31ce557fbb88b30230113c3df8e335 100644 (file)
@@ -286,8 +286,8 @@ struct xt_match {
        void (*destroy)(const struct xt_mtdtor_param *);
 #ifdef CONFIG_COMPAT
        /* Called when userspace align differs from kernel space one */
-       void (*compat_from_user)(void *dst, void *src);
-       int (*compat_to_user)(void __user *dst, void *src);
+       void (*compat_from_user)(void *dst, const void *src);
+       int (*compat_to_user)(void __user *dst, const void *src);
 #endif
        /* Set this to THIS_MODULE if you are a module, otherwise NULL */
        struct module *me;
@@ -328,8 +328,8 @@ struct xt_target {
        void (*destroy)(const struct xt_tgdtor_param *);
 #ifdef CONFIG_COMPAT
        /* Called when userspace align differs from kernel space one */
-       void (*compat_from_user)(void *dst, void *src);
-       int (*compat_to_user)(void __user *dst, void *src);
+       void (*compat_from_user)(void *dst, const void *src);
+       int (*compat_to_user)(void __user *dst, const void *src);
 #endif
        /* Set this to THIS_MODULE if you are a module, otherwise NULL */
        struct module *me;
@@ -593,13 +593,13 @@ extern short xt_compat_calc_jump(u_int8_t af, unsigned int offset);
 extern int xt_compat_match_offset(const struct xt_match *match);
 extern int xt_compat_match_from_user(struct xt_entry_match *m,
                                     void **dstptr, unsigned int *size);
-extern int xt_compat_match_to_user(struct xt_entry_match *m,
+extern int xt_compat_match_to_user(const struct xt_entry_match *m,
                                   void __user **dstptr, unsigned int *size);
 
 extern int xt_compat_target_offset(const struct xt_target *target);
 extern void xt_compat_target_from_user(struct xt_entry_target *t,
                                       void **dstptr, unsigned int *size);
-extern int xt_compat_target_to_user(struct xt_entry_target *t,
+extern int xt_compat_target_to_user(const struct xt_entry_target *t,
                                    void __user **dstptr, unsigned int *size);
 
 #endif /* CONFIG_COMPAT */
index 72723ea1054b6bc1bfe8d2807410a106145e04b8..2303dc92a27765ec1a47afac1e573b20902c3d5e 100644 (file)
@@ -842,7 +842,7 @@ static int copy_entries_to_user(unsigned int total_size,
 }
 
 #ifdef CONFIG_COMPAT
-static void compat_standard_from_user(void *dst, void *src)
+static void compat_standard_from_user(void *dst, const void *src)
 {
        int v = *(compat_int_t *)src;
 
@@ -851,7 +851,7 @@ static void compat_standard_from_user(void *dst, void *src)
        memcpy(dst, &v, sizeof(v));
 }
 
-static int compat_standard_to_user(void __user *dst, void *src)
+static int compat_standard_to_user(void __user *dst, const void *src)
 {
        compat_int_t cv = *(int *)src;
 
index 2057b1bb617823ec0222bff62df8efd3563ea5bf..2a4f745ce36ee67db6e28c26a5b0f929b8023768 100644 (file)
@@ -1047,7 +1047,7 @@ copy_entries_to_user(unsigned int total_size,
 }
 
 #ifdef CONFIG_COMPAT
-static void compat_standard_from_user(void *dst, void *src)
+static void compat_standard_from_user(void *dst, const void *src)
 {
        int v = *(compat_int_t *)src;
 
@@ -1056,7 +1056,7 @@ static void compat_standard_from_user(void *dst, void *src)
        memcpy(dst, &v, sizeof(v));
 }
 
-static int compat_standard_to_user(void __user *dst, void *src)
+static int compat_standard_to_user(void __user *dst, const void *src)
 {
        compat_int_t cv = *(int *)src;
 
index 399061c3fd7d6c6a016bfe5cbcfbb8277a104f01..09a5d3f7cc41e5588febe4fbc6be1e085ce35212 100644 (file)
@@ -338,7 +338,7 @@ struct compat_ipt_ulog_info {
        char            prefix[ULOG_PREFIX_LEN];
 };
 
-static void ulog_tg_compat_from_user(void *dst, void *src)
+static void ulog_tg_compat_from_user(void *dst, const void *src)
 {
        const struct compat_ipt_ulog_info *cl = src;
        struct ipt_ulog_info l = {
@@ -351,7 +351,7 @@ static void ulog_tg_compat_from_user(void *dst, void *src)
        memcpy(dst, &l, sizeof(l));
 }
 
-static int ulog_tg_compat_to_user(void __user *dst, void *src)
+static int ulog_tg_compat_to_user(void __user *dst, const void *src)
 {
        const struct ipt_ulog_info *l = src;
        struct compat_ipt_ulog_info cl = {
index dcd7825fe7b6b4b128fb2256193e5f1614867a60..3ff4fd50e96e81365ed5b648176d99b3dc94861c 100644 (file)
@@ -1079,7 +1079,7 @@ copy_entries_to_user(unsigned int total_size,
 }
 
 #ifdef CONFIG_COMPAT
-static void compat_standard_from_user(void *dst, void *src)
+static void compat_standard_from_user(void *dst, const void *src)
 {
        int v = *(compat_int_t *)src;
 
@@ -1088,7 +1088,7 @@ static void compat_standard_from_user(void *dst, void *src)
        memcpy(dst, &v, sizeof(v));
 }
 
-static int compat_standard_to_user(void __user *dst, void *src)
+static int compat_standard_to_user(void __user *dst, const void *src)
 {
        compat_int_t cv = *(int *)src;
 
index 12503199826f9223ba64551beba15f96956b5d55..69c56287d518d0fc1566d98552a1c9732dff1f5f 100644 (file)
@@ -485,8 +485,8 @@ int xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr,
 }
 EXPORT_SYMBOL_GPL(xt_compat_match_from_user);
 
-int xt_compat_match_to_user(struct xt_entry_match *m, void __user **dstptr,
-                           unsigned int *size)
+int xt_compat_match_to_user(const struct xt_entry_match *m,
+                           void __user **dstptr, unsigned int *size)
 {
        const struct xt_match *match = m->u.kernel.match;
        struct compat_xt_entry_match __user *cm = *dstptr;
@@ -588,8 +588,8 @@ void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr,
 }
 EXPORT_SYMBOL_GPL(xt_compat_target_from_user);
 
-int xt_compat_target_to_user(struct xt_entry_target *t, void __user **dstptr,
-                            unsigned int *size)
+int xt_compat_target_to_user(const struct xt_entry_target *t,
+                            void __user **dstptr, unsigned int *size)
 {
        const struct xt_target *target = t->u.kernel.target;
        struct compat_xt_entry_target __user *ct = *dstptr;
index 017c95966aa8f01e486841c5d6f162874f676bac..e47fb805ffb485e04f3523892892c7cc111f7d43 100644 (file)
@@ -775,7 +775,7 @@ struct compat_xt_hashlimit_info {
        compat_uptr_t master;
 };
 
-static void hashlimit_mt_compat_from_user(void *dst, void *src)
+static void hashlimit_mt_compat_from_user(void *dst, const void *src)
 {
        int off = offsetof(struct compat_xt_hashlimit_info, hinfo);
 
@@ -783,7 +783,7 @@ static void hashlimit_mt_compat_from_user(void *dst, void *src)
        memset(dst + off, 0, sizeof(struct compat_xt_hashlimit_info) - off);
 }
 
-static int hashlimit_mt_compat_to_user(void __user *dst, void *src)
+static int hashlimit_mt_compat_to_user(void __user *dst, const void *src)
 {
        int off = offsetof(struct compat_xt_hashlimit_info, hinfo);
 
index 2773be6a71ddf49a2d8297a3183274472a0a7d61..a0ca5339af41523a174f117a7307e46833711c42 100644 (file)
@@ -148,7 +148,7 @@ struct compat_xt_rateinfo {
 
 /* To keep the full "prev" timestamp, the upper 32 bits are stored in the
  * master pointer, which does not need to be preserved. */
-static void limit_mt_compat_from_user(void *dst, void *src)
+static void limit_mt_compat_from_user(void *dst, const void *src)
 {
        const struct compat_xt_rateinfo *cm = src;
        struct xt_rateinfo m = {
@@ -162,7 +162,7 @@ static void limit_mt_compat_from_user(void *dst, void *src)
        memcpy(dst, &m, sizeof(m));
 }
 
-static int limit_mt_compat_to_user(void __user *dst, void *src)
+static int limit_mt_compat_to_user(void __user *dst, const void *src)
 {
        const struct xt_rateinfo *m = src;
        struct compat_xt_rateinfo cm = {