|
@@ -321,7 +321,7 @@ int xt_find_revision(u8 af, const char *name, u8 revision, int target,
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(xt_find_revision);
|
|
EXPORT_SYMBOL_GPL(xt_find_revision);
|
|
|
|
|
|
-int xt_check_match(struct xt_mtchk_param *par, u_int8_t family,
|
|
|
|
|
|
+int xt_check_match(struct xt_mtchk_param *par,
|
|
unsigned int size, u_int8_t proto, bool inv_proto)
|
|
unsigned int size, u_int8_t proto, bool inv_proto)
|
|
{
|
|
{
|
|
if (XT_ALIGN(par->match->matchsize) != size &&
|
|
if (XT_ALIGN(par->match->matchsize) != size &&
|
|
@@ -331,26 +331,27 @@ int xt_check_match(struct xt_mtchk_param *par, u_int8_t family,
|
|
* because it uses a dynamic-size data set.
|
|
* because it uses a dynamic-size data set.
|
|
*/
|
|
*/
|
|
printk("%s_tables: %s match: invalid size %Zu != %u\n",
|
|
printk("%s_tables: %s match: invalid size %Zu != %u\n",
|
|
- xt_prefix[family], par->match->name,
|
|
|
|
|
|
+ xt_prefix[par->family], par->match->name,
|
|
XT_ALIGN(par->match->matchsize), size);
|
|
XT_ALIGN(par->match->matchsize), size);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
if (par->match->table != NULL &&
|
|
if (par->match->table != NULL &&
|
|
strcmp(par->match->table, par->table) != 0) {
|
|
strcmp(par->match->table, par->table) != 0) {
|
|
printk("%s_tables: %s match: only valid in %s table, not %s\n",
|
|
printk("%s_tables: %s match: only valid in %s table, not %s\n",
|
|
- xt_prefix[family], par->match->name,
|
|
|
|
|
|
+ xt_prefix[par->family], par->match->name,
|
|
par->match->table, par->table);
|
|
par->match->table, par->table);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
if (par->match->hooks && (par->hook_mask & ~par->match->hooks) != 0) {
|
|
if (par->match->hooks && (par->hook_mask & ~par->match->hooks) != 0) {
|
|
printk("%s_tables: %s match: bad hook_mask %#x/%#x\n",
|
|
printk("%s_tables: %s match: bad hook_mask %#x/%#x\n",
|
|
- xt_prefix[family], par->match->name,
|
|
|
|
|
|
+ xt_prefix[par->family], par->match->name,
|
|
par->hook_mask, par->match->hooks);
|
|
par->hook_mask, par->match->hooks);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
if (par->match->proto && (par->match->proto != proto || inv_proto)) {
|
|
if (par->match->proto && (par->match->proto != proto || inv_proto)) {
|
|
printk("%s_tables: %s match: only valid for protocol %u\n",
|
|
printk("%s_tables: %s match: only valid for protocol %u\n",
|
|
- xt_prefix[family], par->match->name, par->match->proto);
|
|
|
|
|
|
+ xt_prefix[par->family], par->match->name,
|
|
|
|
+ par->match->proto);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
if (par->match->checkentry != NULL && !par->match->checkentry(par))
|
|
if (par->match->checkentry != NULL && !par->match->checkentry(par))
|
|
@@ -471,31 +472,31 @@ int xt_compat_match_to_user(struct xt_entry_match *m, void __user **dstptr,
|
|
EXPORT_SYMBOL_GPL(xt_compat_match_to_user);
|
|
EXPORT_SYMBOL_GPL(xt_compat_match_to_user);
|
|
#endif /* CONFIG_COMPAT */
|
|
#endif /* CONFIG_COMPAT */
|
|
|
|
|
|
-int xt_check_target(struct xt_tgchk_param *par, u_int8_t family,
|
|
|
|
|
|
+int xt_check_target(struct xt_tgchk_param *par,
|
|
unsigned int size, u_int8_t proto, bool inv_proto)
|
|
unsigned int size, u_int8_t proto, bool inv_proto)
|
|
{
|
|
{
|
|
if (XT_ALIGN(par->target->targetsize) != size) {
|
|
if (XT_ALIGN(par->target->targetsize) != size) {
|
|
printk("%s_tables: %s target: invalid size %Zu != %u\n",
|
|
printk("%s_tables: %s target: invalid size %Zu != %u\n",
|
|
- xt_prefix[family], par->target->name,
|
|
|
|
|
|
+ xt_prefix[par->family], par->target->name,
|
|
XT_ALIGN(par->target->targetsize), size);
|
|
XT_ALIGN(par->target->targetsize), size);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
if (par->target->table != NULL &&
|
|
if (par->target->table != NULL &&
|
|
strcmp(par->target->table, par->table) != 0) {
|
|
strcmp(par->target->table, par->table) != 0) {
|
|
printk("%s_tables: %s target: only valid in %s table, not %s\n",
|
|
printk("%s_tables: %s target: only valid in %s table, not %s\n",
|
|
- xt_prefix[family], par->target->name,
|
|
|
|
|
|
+ xt_prefix[par->family], par->target->name,
|
|
par->target->table, par->table);
|
|
par->target->table, par->table);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
if (par->target->hooks && (par->hook_mask & ~par->target->hooks) != 0) {
|
|
if (par->target->hooks && (par->hook_mask & ~par->target->hooks) != 0) {
|
|
printk("%s_tables: %s target: bad hook_mask %#x/%#x\n",
|
|
printk("%s_tables: %s target: bad hook_mask %#x/%#x\n",
|
|
- xt_prefix[family], par->target->name, par->hook_mask,
|
|
|
|
- par->target->hooks);
|
|
|
|
|
|
+ xt_prefix[par->family], par->target->name,
|
|
|
|
+ par->hook_mask, par->target->hooks);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
if (par->target->proto && (par->target->proto != proto || inv_proto)) {
|
|
if (par->target->proto && (par->target->proto != proto || inv_proto)) {
|
|
printk("%s_tables: %s target: only valid for protocol %u\n",
|
|
printk("%s_tables: %s target: only valid for protocol %u\n",
|
|
- xt_prefix[family], par->target->name,
|
|
|
|
|
|
+ xt_prefix[par->family], par->target->name,
|
|
par->target->proto);
|
|
par->target->proto);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|