Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bee4bad authored by Jan Engelhardt's avatar Jan Engelhardt
Browse files

netfilter: xt extensions: use pr_<level>

parent be91fd5e
Loading
Loading
Loading
Loading
+6 −7
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@
 * published by the Free Software Foundation.
 * published by the Free Software Foundation.
 *
 *
 */
 */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/skbuff.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/x_tables.h>
@@ -22,8 +23,6 @@
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_ecache.h>
#include <net/netfilter/nf_conntrack_ecache.h>


#define PFX "CONNSECMARK: "

MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("James Morris <jmorris@redhat.com>");
MODULE_AUTHOR("James Morris <jmorris@redhat.com>");
MODULE_DESCRIPTION("Xtables: target for copying between connection and security mark");
MODULE_DESCRIPTION("Xtables: target for copying between connection and security mark");
@@ -91,7 +90,7 @@ static bool connsecmark_tg_check(const struct xt_tgchk_param *par)


	if (strcmp(par->table, "mangle") != 0 &&
	if (strcmp(par->table, "mangle") != 0 &&
	    strcmp(par->table, "security") != 0) {
	    strcmp(par->table, "security") != 0) {
		printk(KERN_INFO PFX "target only valid in the \'mangle\' "
		pr_info("target only valid in the \'mangle\' "
			"or \'security\' tables, not \'%s\'.\n", par->table);
			"or \'security\' tables, not \'%s\'.\n", par->table);
		return false;
		return false;
	}
	}
@@ -102,13 +101,13 @@ static bool connsecmark_tg_check(const struct xt_tgchk_param *par)
		break;
		break;


	default:
	default:
		printk(KERN_INFO PFX "invalid mode: %hu\n", info->mode);
		pr_info("invalid mode: %hu\n", info->mode);
		return false;
		return false;
	}
	}


	if (nf_ct_l3proto_try_module_get(par->family) < 0) {
	if (nf_ct_l3proto_try_module_get(par->family) < 0) {
		printk(KERN_WARNING "can't load conntrack support for "
		pr_info("cannot load conntrack support for proto=%u\n",
				    "proto=%u\n", par->family);
			par->family);
		return false;
		return false;
	}
	}
	return true;
	return true;
+2 −2
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@
 *
 *
 * See RFC2474 for a description of the DSCP field within the IP Header.
 * See RFC2474 for a description of the DSCP field within the IP Header.
*/
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
#include <linux/ip.h>
@@ -65,7 +65,7 @@ static bool dscp_tg_check(const struct xt_tgchk_param *par)
	const struct xt_DSCP_info *info = par->targinfo;
	const struct xt_DSCP_info *info = par->targinfo;


	if (info->dscp > XT_DSCP_MAX) {
	if (info->dscp > XT_DSCP_MAX) {
		printk(KERN_WARNING "DSCP: dscp %x out of range\n", info->dscp);
		pr_info("dscp %x out of range\n", info->dscp);
		return false;
		return false;
	}
	}
	return true;
	return true;
+4 −6
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@
 * it under the terms of the GNU General Public License version 2 as
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 * published by the Free Software Foundation.
 */
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
#include <linux/ip.h>
@@ -106,8 +106,7 @@ static bool ttl_tg_check(const struct xt_tgchk_param *par)
	const struct ipt_TTL_info *info = par->targinfo;
	const struct ipt_TTL_info *info = par->targinfo;


	if (info->mode > IPT_TTL_MAXMODE) {
	if (info->mode > IPT_TTL_MAXMODE) {
		printk(KERN_WARNING "ipt_TTL: invalid or unknown Mode %u\n",
		pr_info("TTL: invalid or unknown mode %u\n", info->mode);
			info->mode);
		return false;
		return false;
	}
	}
	if (info->mode != IPT_TTL_SET && info->ttl == 0)
	if (info->mode != IPT_TTL_SET && info->ttl == 0)
@@ -120,12 +119,11 @@ static bool hl_tg6_check(const struct xt_tgchk_param *par)
	const struct ip6t_HL_info *info = par->targinfo;
	const struct ip6t_HL_info *info = par->targinfo;


	if (info->mode > IP6T_HL_MAXMODE) {
	if (info->mode > IP6T_HL_MAXMODE) {
		printk(KERN_WARNING "ip6t_HL: invalid or unknown Mode %u\n",
		pr_info("invalid or unknown mode %u\n", info->mode);
			info->mode);
		return false;
		return false;
	}
	}
	if (info->mode != IP6T_HL_SET && info->hop_limit == 0) {
	if (info->mode != IP6T_HL_SET && info->hop_limit == 0) {
		printk(KERN_WARNING "ip6t_HL: increment/decrement doesn't "
		pr_info("increment/decrement does not "
			"make sense with value 0\n");
			"make sense with value 0\n");
		return false;
		return false;
	}
	}
+4 −6
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@
 * 02110-1301 USA.
 * 02110-1301 USA.
 *
 *
 */
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/skbuff.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/x_tables.h>
@@ -87,7 +87,7 @@ static bool led_tg_check(const struct xt_tgchk_param *par)
	int err;
	int err;


	if (ledinfo->id[0] == '\0') {
	if (ledinfo->id[0] == '\0') {
		printk(KERN_ERR KBUILD_MODNAME ": No 'id' parameter given.\n");
		pr_info("No 'id' parameter given.\n");
		return false;
		return false;
	}
	}


@@ -99,11 +99,9 @@ static bool led_tg_check(const struct xt_tgchk_param *par)


	err = led_trigger_register(&ledinternal->netfilter_led_trigger);
	err = led_trigger_register(&ledinternal->netfilter_led_trigger);
	if (err) {
	if (err) {
		printk(KERN_CRIT KBUILD_MODNAME
		pr_warning("led_trigger_register() failed\n");
			": led_trigger_register() failed\n");
		if (err == -EEXIST)
		if (err == -EEXIST)
			printk(KERN_ERR KBUILD_MODNAME
			pr_warning("Trigger name is already in use.\n");
				": Trigger name is already in use.\n");
		goto exit_alloc;
		goto exit_alloc;
	}
	}


+10 −10
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@
 * published by the Free Software Foundation.
 * published by the Free Software Foundation.
 *
 *
 */
 */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/skbuff.h>
#include <linux/selinux.h>
#include <linux/selinux.h>
@@ -59,20 +60,19 @@ static bool checkentry_selinux(struct xt_secmark_target_info *info)
	err = selinux_string_to_sid(sel->selctx, &sel->selsid);
	err = selinux_string_to_sid(sel->selctx, &sel->selsid);
	if (err) {
	if (err) {
		if (err == -EINVAL)
		if (err == -EINVAL)
			printk(KERN_INFO PFX "invalid SELinux context \'%s\'\n",
			pr_info("invalid SELinux context \'%s\'\n",
				sel->selctx);
				sel->selctx);
		return false;
		return false;
	}
	}


	if (!sel->selsid) {
	if (!sel->selsid) {
		printk(KERN_INFO PFX "unable to map SELinux context \'%s\'\n",
		pr_info("unable to map SELinux context \'%s\'\n", sel->selctx);
		       sel->selctx);
		return false;
		return false;
	}
	}


	err = selinux_secmark_relabel_packet_permission(sel->selsid);
	err = selinux_secmark_relabel_packet_permission(sel->selsid);
	if (err) {
	if (err) {
		printk(KERN_INFO PFX "unable to obtain relabeling permission\n");
		pr_info("unable to obtain relabeling permission\n");
		return false;
		return false;
	}
	}


@@ -86,13 +86,13 @@ static bool secmark_tg_check(const struct xt_tgchk_param *par)


	if (strcmp(par->table, "mangle") != 0 &&
	if (strcmp(par->table, "mangle") != 0 &&
	    strcmp(par->table, "security") != 0) {
	    strcmp(par->table, "security") != 0) {
		printk(KERN_INFO PFX "target only valid in the \'mangle\' "
		pr_info("target only valid in the \'mangle\' "
			"or \'security\' tables, not \'%s\'.\n", par->table);
			"or \'security\' tables, not \'%s\'.\n", par->table);
		return false;
		return false;
	}
	}


	if (mode && mode != info->mode) {
	if (mode && mode != info->mode) {
		printk(KERN_INFO PFX "mode already set to %hu cannot mix with "
		pr_info("mode already set to %hu cannot mix with "
			"rules for mode %hu\n", mode, info->mode);
			"rules for mode %hu\n", mode, info->mode);
		return false;
		return false;
	}
	}
@@ -104,7 +104,7 @@ static bool secmark_tg_check(const struct xt_tgchk_param *par)
		break;
		break;


	default:
	default:
		printk(KERN_INFO PFX "invalid mode: %hu\n", info->mode);
		pr_info("invalid mode: %hu\n", info->mode);
		return false;
		return false;
	}
	}


Loading