[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>
This commit is contained in:
parent
9c54795950
commit
c9d8fe1317
|
@ -1091,8 +1091,8 @@ static int get_info(void __user *user, int *len, int compat)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (*len != sizeof(struct ipt_getinfo)) {
|
if (*len != sizeof(struct ipt_getinfo)) {
|
||||||
duprintf("length %u != %u\n", *len,
|
duprintf("length %u != %zu\n", *len,
|
||||||
(unsigned int)sizeof(struct ipt_getinfo));
|
sizeof(struct ipt_getinfo));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1151,16 +1151,14 @@ get_entries(struct ipt_get_entries __user *uptr, int *len)
|
||||||
struct xt_table *t;
|
struct xt_table *t;
|
||||||
|
|
||||||
if (*len < sizeof(get)) {
|
if (*len < sizeof(get)) {
|
||||||
duprintf("get_entries: %u < %d\n", *len,
|
duprintf("get_entries: %u < %zu\n", *len, sizeof(get));
|
||||||
(unsigned int)sizeof(get));
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (copy_from_user(&get, uptr, sizeof(get)) != 0)
|
if (copy_from_user(&get, uptr, sizeof(get)) != 0)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
if (*len != sizeof(struct ipt_get_entries) + get.size) {
|
if (*len != sizeof(struct ipt_get_entries) + get.size) {
|
||||||
duprintf("get_entries: %u != %u\n", *len,
|
duprintf("get_entries: %u != %zu\n",
|
||||||
(unsigned int)(sizeof(struct ipt_get_entries) +
|
*len, sizeof(get) + get.size);
|
||||||
get.size));
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1911,8 +1909,7 @@ compat_get_entries(struct compat_ipt_get_entries __user *uptr, int *len)
|
||||||
struct xt_table *t;
|
struct xt_table *t;
|
||||||
|
|
||||||
if (*len < sizeof(get)) {
|
if (*len < sizeof(get)) {
|
||||||
duprintf("compat_get_entries: %u < %u\n",
|
duprintf("compat_get_entries: %u < %zu\n", *len, sizeof(get));
|
||||||
*len, (unsigned int)sizeof(get));
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1920,9 +1917,8 @@ compat_get_entries(struct compat_ipt_get_entries __user *uptr, int *len)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
if (*len != sizeof(struct compat_ipt_get_entries) + get.size) {
|
if (*len != sizeof(struct compat_ipt_get_entries) + get.size) {
|
||||||
duprintf("compat_get_entries: %u != %u\n", *len,
|
duprintf("compat_get_entries: %u != %zu\n",
|
||||||
(unsigned int)(sizeof(struct compat_ipt_get_entries) +
|
*len, sizeof(get) + get.size);
|
||||||
get.size));
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1120,7 +1120,7 @@ static int get_info(void __user *user, int *len, int compat)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (*len != sizeof(struct ip6t_getinfo)) {
|
if (*len != sizeof(struct ip6t_getinfo)) {
|
||||||
duprintf("length %u != %u\n", *len,
|
duprintf("length %u != %zu\n", *len,
|
||||||
sizeof(struct ip6t_getinfo));
|
sizeof(struct ip6t_getinfo));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -1180,14 +1180,14 @@ get_entries(struct ip6t_get_entries __user *uptr, int *len)
|
||||||
struct xt_table *t;
|
struct xt_table *t;
|
||||||
|
|
||||||
if (*len < sizeof(get)) {
|
if (*len < sizeof(get)) {
|
||||||
duprintf("get_entries: %u < %u\n", *len, sizeof(get));
|
duprintf("get_entries: %u < %zu\n", *len, sizeof(get));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (copy_from_user(&get, uptr, sizeof(get)) != 0)
|
if (copy_from_user(&get, uptr, sizeof(get)) != 0)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
if (*len != sizeof(struct ip6t_get_entries) + get.size) {
|
if (*len != sizeof(struct ip6t_get_entries) + get.size) {
|
||||||
duprintf("get_entries: %u != %u\n", *len,
|
duprintf("get_entries: %u != %zu\n",
|
||||||
sizeof(struct ip6t_get_entries) + get.size);
|
*len, sizeof(get) + get.size);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1931,8 +1931,7 @@ compat_get_entries(struct compat_ip6t_get_entries __user *uptr, int *len)
|
||||||
struct xt_table *t;
|
struct xt_table *t;
|
||||||
|
|
||||||
if (*len < sizeof(get)) {
|
if (*len < sizeof(get)) {
|
||||||
duprintf("compat_get_entries: %u < %u\n",
|
duprintf("compat_get_entries: %u < %zu\n", *len, sizeof(get));
|
||||||
*len, (unsigned int)sizeof(get));
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1940,9 +1939,8 @@ compat_get_entries(struct compat_ip6t_get_entries __user *uptr, int *len)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
if (*len != sizeof(struct compat_ip6t_get_entries) + get.size) {
|
if (*len != sizeof(struct compat_ip6t_get_entries) + get.size) {
|
||||||
duprintf("compat_get_entries: %u != %u\n", *len,
|
duprintf("compat_get_entries: %u != %zu\n",
|
||||||
(unsigned int)(sizeof(struct compat_ip6t_get_entries) +
|
*len, sizeof(get) + get.size);
|
||||||
get.size));
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue