Release 4.11 net/bridge/netfilter/ebt_mark.c
/*
* ebt_mark
*
* Authors:
* Bart De Schuymer <bdschuym@pandora.be>
*
* July, 2002
*
*/
/* The mark target can be used in any chain,
* I believe adding a mangle table just for marking is total overkill.
* Marking a frame doesn't really change anything in the frame anyway.
*/
#include <linux/module.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter_bridge/ebtables.h>
#include <linux/netfilter_bridge/ebt_mark_t.h>
static unsigned int
ebt_mark_tg(struct sk_buff *skb, const struct xt_action_param *par)
{
const struct ebt_mark_t_info *info = par->targinfo;
int action = info->target & -16;
if (action == MARK_SET_VALUE)
skb->mark = info->mark;
else if (action == MARK_OR_VALUE)
skb->mark |= info->mark;
else if (action == MARK_AND_VALUE)
skb->mark &= info->mark;
else
skb->mark ^= info->mark;
return info->target | ~EBT_VERDICT_BITS;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Bart De Schuymer | 82 | 82.83% | 3 | 30.00% |
Jan Engelhardt | 8 | 8.08% | 5 | 50.00% |
Herbert Xu | 5 | 5.05% | 1 | 10.00% |
Thomas Graf | 4 | 4.04% | 1 | 10.00% |
Total | 99 | 100.00% | 10 | 100.00% |
static int ebt_mark_tg_check(const struct xt_tgchk_param *par)
{
const struct ebt_mark_t_info *info = par->targinfo;
int tmp;
tmp = info->target | ~EBT_VERDICT_BITS;
if (BASE_CHAIN && tmp == EBT_RETURN)
return -EINVAL;
if (tmp < -NUM_STANDARD_TARGETS || tmp >= 0)
return -EINVAL;
tmp = info->target & ~EBT_VERDICT_BITS;
if (tmp != MARK_SET_VALUE && tmp != MARK_OR_VALUE &&
tmp != MARK_AND_VALUE && tmp != MARK_XOR_VALUE)
return -EINVAL;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Bart De Schuymer | 80 | 84.21% | 3 | 37.50% |
Jan Engelhardt | 15 | 15.79% | 5 | 62.50% |
Total | 95 | 100.00% | 8 | 100.00% |
#ifdef CONFIG_COMPAT
struct compat_ebt_mark_t_info {
compat_ulong_t mark;
compat_uint_t target;
};
static void mark_tg_compat_from_user(void *dst, const void *src)
{
const struct compat_ebt_mark_t_info *user = src;
struct ebt_mark_t_info *kern = dst;
kern->mark = user->mark;
kern->target = user->target;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Florian Westphal | 46 | 100.00% | 1 | 100.00% |
Total | 46 | 100.00% | 1 | 100.00% |
static int mark_tg_compat_to_user(void __user *dst, const void *src)
{
struct compat_ebt_mark_t_info __user *user = dst;
const struct ebt_mark_t_info *kern = src;
if (put_user(kern->mark, &user->mark) ||
put_user(kern->target, &user->target))
return -EFAULT;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Florian Westphal | 65 | 100.00% | 1 | 100.00% |
Total | 65 | 100.00% | 1 | 100.00% |
#endif
static struct xt_target ebt_mark_tg_reg __read_mostly = {
.name = "mark",
.revision = 0,
.family = NFPROTO_BRIDGE,
.target = ebt_mark_tg,
.checkentry = ebt_mark_tg_check,
.targetsize = sizeof(struct ebt_mark_t_info),
#ifdef CONFIG_COMPAT
.compatsize = sizeof(struct compat_ebt_mark_t_info),
.compat_from_user = mark_tg_compat_from_user,
.compat_to_user = mark_tg_compat_to_user,
#endif
.me = THIS_MODULE,
};
static int __init ebt_mark_init(void)
{
return xt_register_target(&ebt_mark_tg_reg);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Bart De Schuymer | 13 | 81.25% | 1 | 33.33% |
Jan Engelhardt | 2 | 12.50% | 1 | 33.33% |
Andrew Morton | 1 | 6.25% | 1 | 33.33% |
Total | 16 | 100.00% | 3 | 100.00% |
static void __exit ebt_mark_fini(void)
{
xt_unregister_target(&ebt_mark_tg_reg);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Bart De Schuymer | 12 | 80.00% | 1 | 33.33% |
Jan Engelhardt | 2 | 13.33% | 1 | 33.33% |
Andrew Morton | 1 | 6.67% | 1 | 33.33% |
Total | 15 | 100.00% | 3 | 100.00% |
module_init(ebt_mark_init);
module_exit(ebt_mark_fini);
MODULE_DESCRIPTION("Ebtables: Packet mark modification");
MODULE_LICENSE("GPL");
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Bart De Schuymer | 229 | 50.11% | 4 | 19.05% |
Florian Westphal | 151 | 33.04% | 1 | 4.76% |
Jan Engelhardt | 64 | 14.00% | 13 | 61.90% |
Herbert Xu | 5 | 1.09% | 1 | 4.76% |
Thomas Graf | 4 | 0.88% | 1 | 4.76% |
Andrew Morton | 4 | 0.88% | 1 | 4.76% |
Total | 457 | 100.00% | 21 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.