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;
28 (*pskb)->nfcache |= NFC_ALTERED;
33 static int ebt_target_mark_check(const char *tablename, unsigned int hookmask,
34 const struct ebt_entry *e, void *data, unsigned int datalen)
36 struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
38 if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_t_info)))
40 if (BASE_CHAIN && info->target == EBT_RETURN)
48 static struct ebt_target mark_target =
50 .name = EBT_MARK_TARGET,
51 .target = ebt_target_mark,
52 .check = ebt_target_mark_check,
56 static int __init init(void)
58 return ebt_register_target(&mark_target);
61 static void __exit fini(void)
63 ebt_unregister_target(&mark_target);
68 MODULE_LICENSE("GPL");