18 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
19 #include <linux/module.h>
21 #include <linux/netfilter/x_tables.h>
28 MODULE_DESCRIPTION(
"Xtables: target for copying between connection and security mark");
36 static void secmark_save(
const struct sk_buff *
skb)
42 ct = nf_ct_get(skb, &ctinfo);
43 if (ct && !ct->secmark) {
44 ct->secmark = skb->secmark;
54 static void secmark_restore(
struct sk_buff *skb)
60 ct = nf_ct_get(skb, &ctinfo);
61 if (ct && ct->secmark)
62 skb->secmark = ct->secmark;
94 pr_info(
"target only valid in the \'mangle\' "
95 "or \'security\' tables, not \'%s\'.\n", par->
table);
111 pr_info(
"cannot load conntrack support for proto=%u\n",
122 .name =
"CONNSECMARK",
125 .checkentry = connsecmark_tg_check,
126 .destroy = connsecmark_tg_destroy,
127 .target = connsecmark_tg,
132 static int __init connsecmark_tg_init(
void)
137 static void __exit connsecmark_tg_exit(
void)