5 * Bart De Schuymer <bdschuym@pandora.be>
11 /* The mark target can be used in any chain,
12 * I believe adding a mangle table just for marking is total overkill.
13 * Marking a frame doesn't really change anything in the frame anyway.
16 #include <linux/netfilter_bridge/ebtables.h>
17 #include <linux/netfilter_bridge/ebt_mark_t.h>
18 #include <linux/module.h>
20 static int ebt_target_mark(struct sk_buff
**pskb
, unsigned int hooknr
,
21 const struct net_device
*in
, const struct net_device
*out
,
22 const void *data
, unsigned int datalen
)
24 struct ebt_mark_t_info
*info
= (struct ebt_mark_t_info
*)data
;
26 if ((*pskb
)->nfmark
!= info
->mark
)
27 (*pskb
)->nfmark
= info
->mark
;
32 static int ebt_target_mark_check(const char *tablename
, unsigned int hookmask
,
33 const struct ebt_entry
*e
, void *data
, unsigned int datalen
)
35 struct ebt_mark_t_info
*info
= (struct ebt_mark_t_info
*)data
;
37 if (datalen
!= EBT_ALIGN(sizeof(struct ebt_mark_t_info
)))
39 if (BASE_CHAIN
&& info
->target
== EBT_RETURN
)
47 static struct ebt_target mark_target
=
49 .name
= EBT_MARK_TARGET
,
50 .target
= ebt_target_mark
,
51 .check
= ebt_target_mark_check
,
55 static int __init
init(void)
57 return ebt_register_target(&mark_target
);
60 static void __exit
fini(void)
62 ebt_unregister_target(&mark_target
);
67 MODULE_LICENSE("GPL");