diff options
author | Patrick McHardy <kaber@trash.net> | 2007-12-18 00:52:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:58:39 -0500 |
commit | c9d8fe13175140c79982f9d29c6921328f9afad6 (patch) | |
tree | 66aa5255f8b8ee769df0be0a3191852f9a513645 | |
parent | 9c54795950d198e77144a18c94e7ed52ea0f3c77 (diff) |
[NETFILTER]: {ip,ip6}_tables: fix format strings
Use %zu for sizeof() and remove casts.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 20 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 16 |
2 files changed, 15 insertions, 21 deletions
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 231f5d290755..98c65ac47d4c 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -1091,8 +1091,8 @@ static int get_info(void __user *user, int *len, int compat) | |||
1091 | int ret; | 1091 | int ret; |
1092 | 1092 | ||
1093 | if (*len != sizeof(struct ipt_getinfo)) { | 1093 | if (*len != sizeof(struct ipt_getinfo)) { |
1094 | duprintf("length %u != %u\n", *len, | 1094 | duprintf("length %u != %zu\n", *len, |
1095 | (unsigned int)sizeof(struct ipt_getinfo)); | 1095 | sizeof(struct ipt_getinfo)); |
1096 | return -EINVAL; | 1096 | return -EINVAL; |
1097 | } | 1097 | } |
1098 | 1098 | ||
@@ -1151,16 +1151,14 @@ get_entries(struct ipt_get_entries __user *uptr, int *len) | |||
1151 | struct xt_table *t; | 1151 | struct xt_table *t; |
1152 | 1152 | ||
1153 | if (*len < sizeof(get)) { | 1153 | if (*len < sizeof(get)) { |
1154 | duprintf("get_entries: %u < %d\n", *len, | 1154 | duprintf("get_entries: %u < %zu\n", *len, sizeof(get)); |
1155 | (unsigned int)sizeof(get)); | ||
1156 | return -EINVAL; | 1155 | return -EINVAL; |
1157 | } | 1156 | } |
1158 | if (copy_from_user(&get, uptr, sizeof(get)) != 0) | 1157 | if (copy_from_user(&get, uptr, sizeof(get)) != 0) |
1159 | return -EFAULT; | 1158 | return -EFAULT; |
1160 | if (*len != sizeof(struct ipt_get_entries) + get.size) { | 1159 | if (*len != sizeof(struct ipt_get_entries) + get.size) { |
1161 | duprintf("get_entries: %u != %u\n", *len, | 1160 | duprintf("get_entries: %u != %zu\n", |
1162 | (unsigned int)(sizeof(struct ipt_get_entries) + | 1161 | *len, sizeof(get) + get.size); |
1163 | get.size)); | ||
1164 | return -EINVAL; | 1162 | return -EINVAL; |
1165 | } | 1163 | } |
1166 | 1164 | ||
@@ -1911,8 +1909,7 @@ compat_get_entries(struct compat_ipt_get_entries __user *uptr, int *len) | |||
1911 | struct xt_table *t; | 1909 | struct xt_table *t; |
1912 | 1910 | ||
1913 | if (*len < sizeof(get)) { | 1911 | if (*len < sizeof(get)) { |
1914 | duprintf("compat_get_entries: %u < %u\n", | 1912 | duprintf("compat_get_entries: %u < %zu\n", *len, sizeof(get)); |
1915 | *len, (unsigned int)sizeof(get)); | ||
1916 | return -EINVAL; | 1913 | return -EINVAL; |
1917 | } | 1914 | } |
1918 | 1915 | ||
@@ -1920,9 +1917,8 @@ compat_get_entries(struct compat_ipt_get_entries __user *uptr, int *len) | |||
1920 | return -EFAULT; | 1917 | return -EFAULT; |
1921 | 1918 | ||
1922 | if (*len != sizeof(struct compat_ipt_get_entries) + get.size) { | 1919 | if (*len != sizeof(struct compat_ipt_get_entries) + get.size) { |
1923 | duprintf("compat_get_entries: %u != %u\n", *len, | 1920 | duprintf("compat_get_entries: %u != %zu\n", |
1924 | (unsigned int)(sizeof(struct compat_ipt_get_entries) + | 1921 | *len, sizeof(get) + get.size); |
1925 | get.size)); | ||
1926 | return -EINVAL; | 1922 | return -EINVAL; |
1927 | } | 1923 | } |
1928 | 1924 | ||
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 0a2ec4b346fb..40893fc05926 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -1120,7 +1120,7 @@ static int get_info(void __user *user, int *len, int compat) | |||
1120 | int ret; | 1120 | int ret; |
1121 | 1121 | ||
1122 | if (*len != sizeof(struct ip6t_getinfo)) { | 1122 | if (*len != sizeof(struct ip6t_getinfo)) { |
1123 | duprintf("length %u != %u\n", *len, | 1123 | duprintf("length %u != %zu\n", *len, |
1124 | sizeof(struct ip6t_getinfo)); | 1124 | sizeof(struct ip6t_getinfo)); |
1125 | return -EINVAL; | 1125 | return -EINVAL; |
1126 | } | 1126 | } |
@@ -1180,14 +1180,14 @@ get_entries(struct ip6t_get_entries __user *uptr, int *len) | |||
1180 | struct xt_table *t; | 1180 | struct xt_table *t; |
1181 | 1181 | ||
1182 | if (*len < sizeof(get)) { | 1182 | if (*len < sizeof(get)) { |
1183 | duprintf("get_entries: %u < %u\n", *len, sizeof(get)); | 1183 | duprintf("get_entries: %u < %zu\n", *len, sizeof(get)); |
1184 | return -EINVAL; | 1184 | return -EINVAL; |
1185 | } | 1185 | } |
1186 | if (copy_from_user(&get, uptr, sizeof(get)) != 0) | 1186 | if (copy_from_user(&get, uptr, sizeof(get)) != 0) |
1187 | return -EFAULT; | 1187 | return -EFAULT; |
1188 | if (*len != sizeof(struct ip6t_get_entries) + get.size) { | 1188 | if (*len != sizeof(struct ip6t_get_entries) + get.size) { |
1189 | duprintf("get_entries: %u != %u\n", *len, | 1189 | duprintf("get_entries: %u != %zu\n", |
1190 | sizeof(struct ip6t_get_entries) + get.size); | 1190 | *len, sizeof(get) + get.size); |
1191 | return -EINVAL; | 1191 | return -EINVAL; |
1192 | } | 1192 | } |
1193 | 1193 | ||
@@ -1931,8 +1931,7 @@ compat_get_entries(struct compat_ip6t_get_entries __user *uptr, int *len) | |||
1931 | struct xt_table *t; | 1931 | struct xt_table *t; |
1932 | 1932 | ||
1933 | if (*len < sizeof(get)) { | 1933 | if (*len < sizeof(get)) { |
1934 | duprintf("compat_get_entries: %u < %u\n", | 1934 | duprintf("compat_get_entries: %u < %zu\n", *len, sizeof(get)); |
1935 | *len, (unsigned int)sizeof(get)); | ||
1936 | return -EINVAL; | 1935 | return -EINVAL; |
1937 | } | 1936 | } |
1938 | 1937 | ||
@@ -1940,9 +1939,8 @@ compat_get_entries(struct compat_ip6t_get_entries __user *uptr, int *len) | |||
1940 | return -EFAULT; | 1939 | return -EFAULT; |
1941 | 1940 | ||
1942 | if (*len != sizeof(struct compat_ip6t_get_entries) + get.size) { | 1941 | if (*len != sizeof(struct compat_ip6t_get_entries) + get.size) { |
1943 | duprintf("compat_get_entries: %u != %u\n", *len, | 1942 | duprintf("compat_get_entries: %u != %zu\n", |
1944 | (unsigned int)(sizeof(struct compat_ip6t_get_entries) + | 1943 | *len, sizeof(get) + get.size); |
1945 | get.size)); | ||
1946 | return -EINVAL; | 1944 | return -EINVAL; |
1947 | } | 1945 | } |
1948 | 1946 | ||